All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/11] ARM: cam60: move cam60_spi_devices to .init.data
@ 2010-07-23 19:58 ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Russell King, Uwe Kleine-König, Samuel R. C. Vale,
	Jiri Kosina, Andrew Victor, linux-kernel

cam60_spi_devices is passed to at91_add_device_spi which calls
spi_register_board_info.  The latter makes a copy of it, so living in
.init.data is OK.

This fixes the following warning in cam60_defconfig:
	WARNING: vmlinux.o(.data+0x2a00): Section mismatch in reference from the variable cam60_spi_devices to the (unknown reference) .init.data:(unknown)
	The variable cam60_spi_devices references
	the (unknown reference) __initdata (unknown)
	If the reference is valid then annotate the
	variable with __init* or __refdata (see linux/init.h) or name the variable:
	*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-at91/board-cam60.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
index 02138af..05c7072 100644
--- a/arch/arm/mach-at91/board-cam60.c
+++ b/arch/arm/mach-at91/board-cam60.c
@@ -98,14 +98,14 @@ static struct mtd_partition __initdata cam60_spi_partitions[] = {
 	},
 };
 
-static struct flash_platform_data __initdata cam60_spi_flash_platform_data = {
+static struct flash_platform_data cam60_spi_flash_platform_data __initdata = {
 	.name		= "spi_flash",
 	.parts		= cam60_spi_partitions,
 	.nr_parts	= ARRAY_SIZE(cam60_spi_partitions)
 };
 #endif
 
-static struct spi_board_info cam60_spi_devices[] = {
+static struct spi_board_info cam60_spi_devices[] __initdata = {
 #if defined(CONFIG_MTD_DATAFLASH)
 	{	/* DataFlash chip */
 		.modalias	= "mtd_dataflash",
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 01/11] ARM: cam60: move cam60_spi_devices to .init.data
@ 2010-07-23 19:58 ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

cam60_spi_devices is passed to at91_add_device_spi which calls
spi_register_board_info.  The latter makes a copy of it, so living in
.init.data is OK.

This fixes the following warning in cam60_defconfig:
	WARNING: vmlinux.o(.data+0x2a00): Section mismatch in reference from the variable cam60_spi_devices to the (unknown reference) .init.data:(unknown)
	The variable cam60_spi_devices references
	the (unknown reference) __initdata (unknown)
	If the reference is valid then annotate the
	variable with __init* or __refdata (see linux/init.h) or name the variable:
	*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-at91/board-cam60.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
index 02138af..05c7072 100644
--- a/arch/arm/mach-at91/board-cam60.c
+++ b/arch/arm/mach-at91/board-cam60.c
@@ -98,14 +98,14 @@ static struct mtd_partition __initdata cam60_spi_partitions[] = {
 	},
 };
 
-static struct flash_platform_data __initdata cam60_spi_flash_platform_data = {
+static struct flash_platform_data cam60_spi_flash_platform_data __initdata = {
 	.name		= "spi_flash",
 	.parts		= cam60_spi_partitions,
 	.nr_parts	= ARRAY_SIZE(cam60_spi_partitions)
 };
 #endif
 
-static struct spi_board_info cam60_spi_devices[] = {
+static struct spi_board_info cam60_spi_devices[] __initdata = {
 #if defined(CONFIG_MTD_DATAFLASH)
 	{	/* DataFlash chip */
 		.modalias	= "mtd_dataflash",
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 02/11] ARM: kirkwood: move qnap_tsx1x_register_flash() to .init.text
  2010-07-23 19:58 ` Uwe Kleine-König
@ 2010-07-23 19:58   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Lennert Buytenhek, Nicolas Pitre, Russell King,
	Uwe Kleine-König, Martin Michlmayr, linux-kernel

qnap_tsx1x_register_flash is only called by qnap_ts219_init and
qnap_ts41x_init which both live in .init.text, too.  So the move is OK.

This fixes the following warning in kirkwood_defconfig:
	WARNING: vmlinux.o(.text+0x9334): Section mismatch in reference from the function qnap_tsx1x_register_flash() to the variable .init.data:qnap_tsx1x_spi_slave_info
	The function qnap_tsx1x_register_flash() references
	the variable __initdata qnap_tsx1x_spi_slave_info.
	This is often because qnap_tsx1x_register_flash lacks a __initdata
	annotation or the annotation of qnap_tsx1x_spi_slave_info is wrong.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-kirkwood/tsx1x-common.c |    2 +-
 arch/arm/mach-kirkwood/tsx1x-common.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-kirkwood/tsx1x-common.c b/arch/arm/mach-kirkwood/tsx1x-common.c
index 7221c20..f781164 100644
--- a/arch/arm/mach-kirkwood/tsx1x-common.c
+++ b/arch/arm/mach-kirkwood/tsx1x-common.c
@@ -77,7 +77,7 @@ struct spi_board_info __initdata qnap_tsx1x_spi_slave_info[] = {
 	},
 };
 
-void qnap_tsx1x_register_flash(void)
+void __init qnap_tsx1x_register_flash(void)
 {
 	spi_register_board_info(qnap_tsx1x_spi_slave_info,
 				ARRAY_SIZE(qnap_tsx1x_spi_slave_info));
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.h b/arch/arm/mach-kirkwood/tsx1x-common.h
index 9a59296..7fa0373 100644
--- a/arch/arm/mach-kirkwood/tsx1x-common.h
+++ b/arch/arm/mach-kirkwood/tsx1x-common.h
@@ -1,7 +1,7 @@
 #ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H
 #define __ARCH_KIRKWOOD_TSX1X_COMMON_H
 
-extern void qnap_tsx1x_register_flash(void);
+extern void __init qnap_tsx1x_register_flash(void);
 extern void qnap_tsx1x_power_off(void);
 
 #endif
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 02/11] ARM: kirkwood: move qnap_tsx1x_register_flash() to .init.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

qnap_tsx1x_register_flash is only called by qnap_ts219_init and
qnap_ts41x_init which both live in .init.text, too.  So the move is OK.

This fixes the following warning in kirkwood_defconfig:
	WARNING: vmlinux.o(.text+0x9334): Section mismatch in reference from the function qnap_tsx1x_register_flash() to the variable .init.data:qnap_tsx1x_spi_slave_info
	The function qnap_tsx1x_register_flash() references
	the variable __initdata qnap_tsx1x_spi_slave_info.
	This is often because qnap_tsx1x_register_flash lacks a __initdata
	annotation or the annotation of qnap_tsx1x_spi_slave_info is wrong.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-kirkwood/tsx1x-common.c |    2 +-
 arch/arm/mach-kirkwood/tsx1x-common.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-kirkwood/tsx1x-common.c b/arch/arm/mach-kirkwood/tsx1x-common.c
index 7221c20..f781164 100644
--- a/arch/arm/mach-kirkwood/tsx1x-common.c
+++ b/arch/arm/mach-kirkwood/tsx1x-common.c
@@ -77,7 +77,7 @@ struct spi_board_info __initdata qnap_tsx1x_spi_slave_info[] = {
 	},
 };
 
-void qnap_tsx1x_register_flash(void)
+void __init qnap_tsx1x_register_flash(void)
 {
 	spi_register_board_info(qnap_tsx1x_spi_slave_info,
 				ARRAY_SIZE(qnap_tsx1x_spi_slave_info));
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.h b/arch/arm/mach-kirkwood/tsx1x-common.h
index 9a59296..7fa0373 100644
--- a/arch/arm/mach-kirkwood/tsx1x-common.h
+++ b/arch/arm/mach-kirkwood/tsx1x-common.h
@@ -1,7 +1,7 @@
 #ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H
 #define __ARCH_KIRKWOOD_TSX1X_COMMON_H
 
-extern void qnap_tsx1x_register_flash(void);
+extern void __init qnap_tsx1x_register_flash(void);
 extern void qnap_tsx1x_power_off(void);
 
 #endif
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 03/11] ARM: sa1111: move __sa1111_probe() to .devinit.text
  2010-07-23 19:58 ` Uwe Kleine-König
@ 2010-07-23 19:58   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Russell King, Marek Vasut, H Hartley Sweeten,
	Uwe Kleine-König, Kristoffer Ericson, linux-kernel

__sa1111_probe is only called by sa1111_probe that lives in .devinit.text.
So it's save to move the former to .devinit.text, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/common/sa1111.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 6f80665..97c5bc9 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -681,7 +681,7 @@ out:
  *	%-EBUSY		physical address already marked in-use.
  *	%0		successful.
  */
-static int
+static int __devinit
 __sa1111_probe(struct device *me, struct resource *mem, int irq)
 {
 	struct sa1111 *sachip;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 03/11] ARM: sa1111: move __sa1111_probe() to .devinit.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

__sa1111_probe is only called by sa1111_probe that lives in .devinit.text.
So it's save to move the former to .devinit.text, too.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/common/sa1111.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 6f80665..97c5bc9 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -681,7 +681,7 @@ out:
  *	%-EBUSY		physical address already marked in-use.
  *	%0		successful.
  */
-static int
+static int __devinit
 __sa1111_probe(struct device *me, struct resource *mem, int irq)
 {
 	struct sa1111 *sachip;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 04/11] ARM: omap: move omap_init_fb to .init.text
  2010-07-23 19:58 ` Uwe Kleine-König
  (?)
@ 2010-07-23 19:58   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Tony Lindgren, Russell King, Uwe Kleine-König,
	Tomi Valkeinen, linux-omap, linux-kernel

omap_init_fb() is only called as arch_initcall and so can live in
.init.text.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index d3eea4f..e8a390d 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -307,7 +307,7 @@ void omapfb_set_ctrl_platform_data(void *data)
 	omapfb_config.ctrl_platform_data = data;
 }
 
-static inline int omap_init_fb(void)
+static int __init omap_init_fb(void)
 {
 	const struct omap_lcd_config *conf;
 
@@ -352,7 +352,7 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
 	omapfb_config = *data;
 }
 
-static inline int omap_init_fb(void)
+static int __init omap_init_fb(void)
 {
 	return platform_device_register(&omap_fb_device);
 }
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 04/11] ARM: omap: move omap_init_fb to .init.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Russell King, Tony Lindgren, linux-kernel, Uwe Kleine-König,
	Tomi Valkeinen, linux-omap

omap_init_fb() is only called as arch_initcall and so can live in
.init.text.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index d3eea4f..e8a390d 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -307,7 +307,7 @@ void omapfb_set_ctrl_platform_data(void *data)
 	omapfb_config.ctrl_platform_data = data;
 }
 
-static inline int omap_init_fb(void)
+static int __init omap_init_fb(void)
 {
 	const struct omap_lcd_config *conf;
 
@@ -352,7 +352,7 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
 	omapfb_config = *data;
 }
 
-static inline int omap_init_fb(void)
+static int __init omap_init_fb(void)
 {
 	return platform_device_register(&omap_fb_device);
 }
-- 
1.7.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 04/11] ARM: omap: move omap_init_fb to .init.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

omap_init_fb() is only called as arch_initcall and so can live in
.init.text.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index d3eea4f..e8a390d 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -307,7 +307,7 @@ void omapfb_set_ctrl_platform_data(void *data)
 	omapfb_config.ctrl_platform_data = data;
 }
 
-static inline int omap_init_fb(void)
+static int __init omap_init_fb(void)
 {
 	const struct omap_lcd_config *conf;
 
@@ -352,7 +352,7 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
 	omapfb_config = *data;
 }
 
-static inline int omap_init_fb(void)
+static int __init omap_init_fb(void)
 {
 	return platform_device_register(&omap_fb_device);
 }
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 05/11] ARM: omap1: nokia770: move mipid_dev_init() to .init.text
  2010-07-23 19:58 ` Uwe Kleine-König
  (?)
@ 2010-07-23 19:58   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Tony Lindgren, Russell King, Uwe Kleine-König,
	Tomi Valkeinen, linux-omap, linux-kernel

mipid_dev_init() is only called by omap_nokia770_init that lives in
.init.text.  So it's save to move the former to .init.text, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-omap1/board-nokia770.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 71e1a3f..6c4dd0e 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -113,7 +113,7 @@ static struct mipid_platform_data nokia770_mipid_platform_data = {
 	.shutdown = mipid_shutdown,
 };
 
-static void mipid_dev_init(void)
+static void __init mipid_dev_init(void)
 {
 	const struct omap_lcd_config *conf;
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 05/11] ARM: omap1: nokia770: move mipid_dev_init() to .init.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Tony Lindgren, Russell King, Uwe Kleine-König,
	Tomi Valkeinen, linux-omap, linux-kernel

mipid_dev_init() is only called by omap_nokia770_init that lives in
.init.text.  So it's save to move the former to .init.text, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-omap1/board-nokia770.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 71e1a3f..6c4dd0e 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -113,7 +113,7 @@ static struct mipid_platform_data nokia770_mipid_platform_data = {
 	.shutdown = mipid_shutdown,
 };
 
-static void mipid_dev_init(void)
+static void __init mipid_dev_init(void)
 {
 	const struct omap_lcd_config *conf;
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 05/11] ARM: omap1: nokia770: move mipid_dev_init() to .init.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

mipid_dev_init() is only called by omap_nokia770_init that lives in
.init.text.  So it's save to move the former to .init.text, too.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-omap1/board-nokia770.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 71e1a3f..6c4dd0e 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -113,7 +113,7 @@ static struct mipid_platform_data nokia770_mipid_platform_data = {
 	.shutdown = mipid_shutdown,
 };
 
-static void mipid_dev_init(void)
+static void __init mipid_dev_init(void)
 {
 	const struct omap_lcd_config *conf;
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 06/11] ARM: omap: move omapfb_reserve_sdram() to .init.text
  2010-07-23 19:58 ` Uwe Kleine-König
  (?)
@ 2010-07-23 19:58   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Tony Lindgren, Russell King, Uwe Kleine-König,
	Tomi Valkeinen, linux-omap, linux-kernel

omapfb_reserve_sdram() is only called by omap1_map_common_io() and
_omap2_map_common_io() that both live in .init.text.  So this is save
for omapfb_reserve_sdram(), too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index e8a390d..4df210f 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -359,7 +359,7 @@ static int __init omap_init_fb(void)
 
 arch_initcall(omap_init_fb);
 
-void omapfb_reserve_sdram(void) {}
+void __init omapfb_reserve_sdram(void) {}
 unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
@@ -375,7 +375,7 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
 {
 }
 
-void omapfb_reserve_sdram(void) {}
+void __init omapfb_reserve_sdram(void) {}
 unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 06/11] ARM: omap: move omapfb_reserve_sdram() to .init.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Russell King, Tony Lindgren, linux-kernel, Uwe Kleine-König,
	Tomi Valkeinen, linux-omap

omapfb_reserve_sdram() is only called by omap1_map_common_io() and
_omap2_map_common_io() that both live in .init.text.  So this is save
for omapfb_reserve_sdram(), too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index e8a390d..4df210f 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -359,7 +359,7 @@ static int __init omap_init_fb(void)
 
 arch_initcall(omap_init_fb);
 
-void omapfb_reserve_sdram(void) {}
+void __init omapfb_reserve_sdram(void) {}
 unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
@@ -375,7 +375,7 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
 {
 }
 
-void omapfb_reserve_sdram(void) {}
+void __init omapfb_reserve_sdram(void) {}
 unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
-- 
1.7.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 06/11] ARM: omap: move omapfb_reserve_sdram() to .init.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

omapfb_reserve_sdram() is only called by omap1_map_common_io() and
_omap2_map_common_io() that both live in .init.text.  So this is save
for omapfb_reserve_sdram(), too.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index e8a390d..4df210f 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -359,7 +359,7 @@ static int __init omap_init_fb(void)
 
 arch_initcall(omap_init_fb);
 
-void omapfb_reserve_sdram(void) {}
+void __init omapfb_reserve_sdram(void) {}
 unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
@@ -375,7 +375,7 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
 {
 }
 
-void omapfb_reserve_sdram(void) {}
+void __init omapfb_reserve_sdram(void) {}
 unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 07/11] ARM: omap: move omapfb_reserve_sram() to .init.text
  2010-07-23 19:58 ` Uwe Kleine-König
  (?)
@ 2010-07-23 19:58   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Tony Lindgren, Russell King, Uwe Kleine-König,
	Tomi Valkeinen, Santosh Shilimkar, Paul Walmsley, janboe,
	linux-omap, linux-kernel

omapfb_reserve_sram() is only called by omap_detect_sram() which lives in
.init.text.  So this is save for omapfb_reserve_sram(), too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c   |    6 +++---
 arch/arm/plat-omap/sram.c |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index 4df210f..4c0ae4d 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -233,7 +233,7 @@ void __init omapfb_reserve_sdram(void)
  * this point, since the driver built as a module would have problem with
  * freeing / reallocating the regions.
  */
-unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
 				  unsigned long pstart_avail,
@@ -360,7 +360,7 @@ static int __init omap_init_fb(void)
 arch_initcall(omap_init_fb);
 
 void __init omapfb_reserve_sdram(void) {}
-unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
 				  unsigned long start_avail,
@@ -376,7 +376,7 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
 }
 
 void __init omapfb_reserve_sdram(void) {}
-unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
 				  unsigned long start_avail,
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 226b2e8..ccd6623 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -79,7 +79,7 @@ static unsigned long omap_sram_base;
 static unsigned long omap_sram_size;
 static unsigned long omap_sram_ceil;
 
-extern unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+extern unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
 					 unsigned long sram_vstart,
 					 unsigned long sram_size,
 					 unsigned long pstart_avail,
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 07/11] ARM: omap: move omapfb_reserve_sram() to .init.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Paul Walmsley, Russell King, Tony Lindgren, janboe, linux-kernel,
	Santosh Shilimkar, Uwe Kleine-König, Tomi Valkeinen,
	linux-omap

omapfb_reserve_sram() is only called by omap_detect_sram() which lives in
.init.text.  So this is save for omapfb_reserve_sram(), too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c   |    6 +++---
 arch/arm/plat-omap/sram.c |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index 4df210f..4c0ae4d 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -233,7 +233,7 @@ void __init omapfb_reserve_sdram(void)
  * this point, since the driver built as a module would have problem with
  * freeing / reallocating the regions.
  */
-unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
 				  unsigned long pstart_avail,
@@ -360,7 +360,7 @@ static int __init omap_init_fb(void)
 arch_initcall(omap_init_fb);
 
 void __init omapfb_reserve_sdram(void) {}
-unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
 				  unsigned long start_avail,
@@ -376,7 +376,7 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
 }
 
 void __init omapfb_reserve_sdram(void) {}
-unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
 				  unsigned long start_avail,
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 226b2e8..ccd6623 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -79,7 +79,7 @@ static unsigned long omap_sram_base;
 static unsigned long omap_sram_size;
 static unsigned long omap_sram_ceil;
 
-extern unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+extern unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
 					 unsigned long sram_vstart,
 					 unsigned long sram_size,
 					 unsigned long pstart_avail,
-- 
1.7.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 07/11] ARM: omap: move omapfb_reserve_sram() to .init.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

omapfb_reserve_sram() is only called by omap_detect_sram() which lives in
.init.text.  So this is save for omapfb_reserve_sram(), too.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c   |    6 +++---
 arch/arm/plat-omap/sram.c |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index 4df210f..4c0ae4d 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -233,7 +233,7 @@ void __init omapfb_reserve_sdram(void)
  * this point, since the driver built as a module would have problem with
  * freeing / reallocating the regions.
  */
-unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
 				  unsigned long pstart_avail,
@@ -360,7 +360,7 @@ static int __init omap_init_fb(void)
 arch_initcall(omap_init_fb);
 
 void __init omapfb_reserve_sdram(void) {}
-unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
 				  unsigned long start_avail,
@@ -376,7 +376,7 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
 }
 
 void __init omapfb_reserve_sdram(void) {}
-unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
 				  unsigned long sram_vstart,
 				  unsigned long sram_size,
 				  unsigned long start_avail,
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 226b2e8..ccd6623 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -79,7 +79,7 @@ static unsigned long omap_sram_base;
 static unsigned long omap_sram_size;
 static unsigned long omap_sram_ceil;
 
-extern unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+extern unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
 					 unsigned long sram_vstart,
 					 unsigned long sram_size,
 					 unsigned long pstart_avail,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 08/11] ARM: omap: move get_fbmem_region() to .init.text
  2010-07-23 19:58 ` Uwe Kleine-König
  (?)
@ 2010-07-23 19:58   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Tony Lindgren, Russell King, Uwe Kleine-König,
	Tomi Valkeinen, linux-omap, linux-kernel

get_fbmem_region() is only called by omapfb_reserve_sdram() and
omapfb_reserve_sram() that both live in .init.text.  So get_fbmem_region
can go there, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index 4c0ae4d..e05e320 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -94,7 +94,7 @@ static int fbmem_region_reserved(unsigned long start, size_t size)
  * Get the region_idx`th region from board config/ATAG and convert it to
  * our internal format.
  */
-static int get_fbmem_region(int region_idx, struct omapfb_mem_region *rg)
+static int __init get_fbmem_region(int region_idx, struct omapfb_mem_region *rg)
 {
 	const struct omap_fbmem_config	*conf;
 	u32				paddr;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 08/11] ARM: omap: move get_fbmem_region() to .init.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Russell King, Tony Lindgren, linux-kernel, Uwe Kleine-König,
	Tomi Valkeinen, linux-omap

get_fbmem_region() is only called by omapfb_reserve_sdram() and
omapfb_reserve_sram() that both live in .init.text.  So get_fbmem_region
can go there, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index 4c0ae4d..e05e320 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -94,7 +94,7 @@ static int fbmem_region_reserved(unsigned long start, size_t size)
  * Get the region_idx`th region from board config/ATAG and convert it to
  * our internal format.
  */
-static int get_fbmem_region(int region_idx, struct omapfb_mem_region *rg)
+static int __init get_fbmem_region(int region_idx, struct omapfb_mem_region *rg)
 {
 	const struct omap_fbmem_config	*conf;
 	u32				paddr;
-- 
1.7.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 08/11] ARM: omap: move get_fbmem_region() to .init.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

get_fbmem_region() is only called by omapfb_reserve_sdram() and
omapfb_reserve_sram() that both live in .init.text.  So get_fbmem_region
can go there, too.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index 4c0ae4d..e05e320 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -94,7 +94,7 @@ static int fbmem_region_reserved(unsigned long start, size_t size)
  * Get the region_idx`th region from board config/ATAG and convert it to
  * our internal format.
  */
-static int get_fbmem_region(int region_idx, struct omapfb_mem_region *rg)
+static int __init get_fbmem_region(int region_idx, struct omapfb_mem_region *rg)
 {
 	const struct omap_fbmem_config	*conf;
 	u32				paddr;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 09/11] ARM: omap: move omap_get_config et al. to .init.text
  2010-07-23 19:58 ` Uwe Kleine-König
@ 2010-07-23 19:58   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Tony Lindgren, Russell King, Santosh Shilimkar, Kevin Hilman,
	Aaro Koskinen, Paul Walmsley, Sanjeev Premi, Ajay Kumar Gupta,
	Vikram Pandita, Uwe Kleine-König, linux-omap, linux-kernel

All callers of these functions live in .init.text, so these can go there,
too.  There they must not be exported anymore, this is no problem though,
as all callers are always built-in.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/common.c             |    6 ++----
 arch/arm/plat-omap/include/plat/board.h |    4 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 219c01e..3737dae 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -69,17 +69,15 @@ static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
 	return kinfo->data;
 }
 
-const void *__omap_get_config(u16 tag, size_t len, int nr)
+const void *__init __omap_get_config(u16 tag, size_t len, int nr)
 {
         return get_config(tag, len, nr, NULL);
 }
-EXPORT_SYMBOL(__omap_get_config);
 
-const void *omap_get_var_config(u16 tag, size_t *len)
+const void *__init omap_get_var_config(u16 tag, size_t *len)
 {
         return get_config(tag, NO_LENGTH_CHECK, 0, len);
 }
-EXPORT_SYMBOL(omap_get_var_config);
 
 /*
  * 32KHz clocksource ... always available, on pretty most chips except
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
index 5cd6220..7decf58 100644
--- a/arch/arm/plat-omap/include/plat/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -143,14 +143,14 @@ struct omap_board_config_kernel {
 	const void *data;
 };
 
-extern const void *__omap_get_config(u16 tag, size_t len, int nr);
+extern const void *__init __omap_get_config(u16 tag, size_t len, int nr);
 
 #define omap_get_config(tag, type) \
 	((const type *) __omap_get_config((tag), sizeof(type), 0))
 #define omap_get_nr_config(tag, type, nr) \
 	((const type *) __omap_get_config((tag), sizeof(type), (nr)))
 
-extern const void *omap_get_var_config(u16 tag, size_t *len);
+extern const void *__init omap_get_var_config(u16 tag, size_t *len);
 
 extern struct omap_board_config_kernel *omap_board_config;
 extern int omap_board_config_size;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 09/11] ARM: omap: move omap_get_config et al. to .init.text
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

All callers of these functions live in .init.text, so these can go there,
too.  There they must not be exported anymore, this is no problem though,
as all callers are always built-in.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/common.c             |    6 ++----
 arch/arm/plat-omap/include/plat/board.h |    4 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 219c01e..3737dae 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -69,17 +69,15 @@ static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
 	return kinfo->data;
 }
 
-const void *__omap_get_config(u16 tag, size_t len, int nr)
+const void *__init __omap_get_config(u16 tag, size_t len, int nr)
 {
         return get_config(tag, len, nr, NULL);
 }
-EXPORT_SYMBOL(__omap_get_config);
 
-const void *omap_get_var_config(u16 tag, size_t *len)
+const void *__init omap_get_var_config(u16 tag, size_t *len)
 {
         return get_config(tag, NO_LENGTH_CHECK, 0, len);
 }
-EXPORT_SYMBOL(omap_get_var_config);
 
 /*
  * 32KHz clocksource ... always available, on pretty most chips except
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
index 5cd6220..7decf58 100644
--- a/arch/arm/plat-omap/include/plat/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -143,14 +143,14 @@ struct omap_board_config_kernel {
 	const void *data;
 };
 
-extern const void *__omap_get_config(u16 tag, size_t len, int nr);
+extern const void *__init __omap_get_config(u16 tag, size_t len, int nr);
 
 #define omap_get_config(tag, type) \
 	((const type *) __omap_get_config((tag), sizeof(type), 0))
 #define omap_get_nr_config(tag, type, nr) \
 	((const type *) __omap_get_config((tag), sizeof(type), (nr)))
 
-extern const void *omap_get_var_config(u16 tag, size_t *len);
+extern const void *__init omap_get_var_config(u16 tag, size_t *len);
 
 extern struct omap_board_config_kernel *omap_board_config;
 extern int omap_board_config_size;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 10/11] wip: ARM: omap: move omap_board_config_kernel to .init.data
  2010-07-23 19:58 ` Uwe Kleine-König
@ 2010-07-23 19:58   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Tony Lindgren, Russell King, Santosh Shilimkar, Kevin Hilman,
	Aaro Koskinen, Paul Walmsley, linux-omap, linux-kernel

Probably this works ...
---
 arch/arm/plat-omap/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 3737dae..fb9d5c2 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -44,7 +44,7 @@
 
 #define NO_LENGTH_CHECK 0xffffffff
 
-struct omap_board_config_kernel *omap_board_config;
+struct omap_board_config_kernel *omap_board_config __initdata;
 int omap_board_config_size;
 
 static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 10/11] wip: ARM: omap: move omap_board_config_kernel to .init.data
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

Probably this works ...
---
 arch/arm/plat-omap/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 3737dae..fb9d5c2 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -44,7 +44,7 @@
 
 #define NO_LENGTH_CHECK 0xffffffff
 
-struct omap_board_config_kernel *omap_board_config;
+struct omap_board_config_kernel *omap_board_config __initdata;
 int omap_board_config_size;
 
 static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 11/11] ARM: omap: ams-delta: move config to .init.data
  2010-07-23 19:58 ` Uwe Kleine-König
  (?)
@ 2010-07-23 19:58   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Tony Lindgren, Russell King, Janusz Krzysztofik, Kalle Valo,
	Uwe Kleine-König, Kevin Hilman, linux-omap, linux-kernel

Most other boards have their config in .init.data, too, so this should
be OK.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-omap1/board-ams-delta.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index fdd1dd5..6b936cc 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -173,7 +173,7 @@ static struct omap_usb_config ams_delta_usb_config __initdata = {
 	.pins[0]	= 2,
 };
 
-static struct omap_board_config_kernel ams_delta_config[] = {
+static struct omap_board_config_kernel ams_delta_config[] __initdata = {
 	{ OMAP_TAG_LCD,		&ams_delta_lcd_config },
 };
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 11/11] ARM: omap: ams-delta: move config to .init.data
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Tony Lindgren, Russell King, Janusz Krzysztofik, Kalle Valo,
	Uwe Kleine-König, Kevin Hilman, linux-omap, linux-kernel

Most other boards have their config in .init.data, too, so this should
be OK.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-omap1/board-ams-delta.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index fdd1dd5..6b936cc 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -173,7 +173,7 @@ static struct omap_usb_config ams_delta_usb_config __initdata = {
 	.pins[0]	= 2,
 };
 
-static struct omap_board_config_kernel ams_delta_config[] = {
+static struct omap_board_config_kernel ams_delta_config[] __initdata = {
 	{ OMAP_TAG_LCD,		&ams_delta_lcd_config },
 };
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 11/11] ARM: omap: ams-delta: move config to .init.data
@ 2010-07-23 19:58   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-23 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

Most other boards have their config in .init.data, too, so this should
be OK.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-omap1/board-ams-delta.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index fdd1dd5..6b936cc 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -173,7 +173,7 @@ static struct omap_usb_config ams_delta_usb_config __initdata = {
 	.pins[0]	= 2,
 };
 
-static struct omap_board_config_kernel ams_delta_config[] = {
+static struct omap_board_config_kernel ams_delta_config[] __initdata = {
 	{ OMAP_TAG_LCD,		&ams_delta_lcd_config },
 };
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* Re: [PATCH 03/11] ARM: sa1111: move __sa1111_probe() to .devinit.text
  2010-07-23 19:58   ` Uwe Kleine-König
@ 2010-07-23 20:23     ` Kristoffer Ericson
  -1 siblings, 0 replies; 81+ messages in thread
From: Kristoffer Ericson @ 2010-07-23 20:23 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-arm-kernel, Russell King, Marek Vasut, H Hartley Sweeten,
	linux-kernel


you beat me to it :)

Acked-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>

On Fri, Jul 23, 2010 at 09:58:26PM +0200, Uwe Kleine-König wrote:
> __sa1111_probe is only called by sa1111_probe that lives in .devinit.text.
> So it's save to move the former to .devinit.text, too.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  arch/arm/common/sa1111.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
> index 6f80665..97c5bc9 100644
> --- a/arch/arm/common/sa1111.c
> +++ b/arch/arm/common/sa1111.c
> @@ -681,7 +681,7 @@ out:
>   *	%-EBUSY		physical address already marked in-use.
>   *	%0		successful.
>   */
> -static int
> +static int __devinit
>  __sa1111_probe(struct device *me, struct resource *mem, int irq)
>  {
>  	struct sa1111 *sachip;
> -- 
> 1.7.1

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 03/11] ARM: sa1111: move __sa1111_probe() to .devinit.text
@ 2010-07-23 20:23     ` Kristoffer Ericson
  0 siblings, 0 replies; 81+ messages in thread
From: Kristoffer Ericson @ 2010-07-23 20:23 UTC (permalink / raw)
  To: linux-arm-kernel


you beat me to it :)

Acked-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>

On Fri, Jul 23, 2010 at 09:58:26PM +0200, Uwe Kleine-K?nig wrote:
> __sa1111_probe is only called by sa1111_probe that lives in .devinit.text.
> So it's save to move the former to .devinit.text, too.
> 
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> ---
>  arch/arm/common/sa1111.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
> index 6f80665..97c5bc9 100644
> --- a/arch/arm/common/sa1111.c
> +++ b/arch/arm/common/sa1111.c
> @@ -681,7 +681,7 @@ out:
>   *	%-EBUSY		physical address already marked in-use.
>   *	%0		successful.
>   */
> -static int
> +static int __devinit
>  __sa1111_probe(struct device *me, struct resource *mem, int irq)
>  {
>  	struct sa1111 *sachip;
> -- 
> 1.7.1

^ permalink raw reply	[flat|nested] 81+ messages in thread

* Re: [PATCH 06/11] ARM: omap: move omapfb_reserve_sdram() to .init.text
  2010-07-23 19:58   ` Uwe Kleine-König
  (?)
@ 2010-07-23 21:15     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 81+ messages in thread
From: Russell King - ARM Linux @ 2010-07-23 21:15 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-arm-kernel, Tony Lindgren, linux-kernel, Tomi Valkeinen,
	linux-omap

On Fri, Jul 23, 2010 at 09:58:29PM +0200, Uwe Kleine-König wrote:
> omapfb_reserve_sdram() is only called by omap1_map_common_io() and
> _omap2_map_common_io() that both live in .init.text.  So this is save
> for omapfb_reserve_sdram(), too.

NAK.  This clashes with the memblock stuff.

^ permalink raw reply	[flat|nested] 81+ messages in thread

* Re: [PATCH 06/11] ARM: omap: move omapfb_reserve_sdram() to .init.text
@ 2010-07-23 21:15     ` Russell King - ARM Linux
  0 siblings, 0 replies; 81+ messages in thread
From: Russell King - ARM Linux @ 2010-07-23 21:15 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-arm-kernel, Tony Lindgren, linux-kernel, Tomi Valkeinen,
	linux-omap

On Fri, Jul 23, 2010 at 09:58:29PM +0200, Uwe Kleine-König wrote:
> omapfb_reserve_sdram() is only called by omap1_map_common_io() and
> _omap2_map_common_io() that both live in .init.text.  So this is save
> for omapfb_reserve_sdram(), too.

NAK.  This clashes with the memblock stuff.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 06/11] ARM: omap: move omapfb_reserve_sdram() to .init.text
@ 2010-07-23 21:15     ` Russell King - ARM Linux
  0 siblings, 0 replies; 81+ messages in thread
From: Russell King - ARM Linux @ 2010-07-23 21:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 23, 2010 at 09:58:29PM +0200, Uwe Kleine-K?nig wrote:
> omapfb_reserve_sdram() is only called by omap1_map_common_io() and
> _omap2_map_common_io() that both live in .init.text.  So this is save
> for omapfb_reserve_sdram(), too.

NAK.  This clashes with the memblock stuff.

^ permalink raw reply	[flat|nested] 81+ messages in thread

* Re: [PATCH 07/11] ARM: omap: move omapfb_reserve_sram() to .init.text
  2010-07-23 19:58   ` Uwe Kleine-König
  (?)
@ 2010-07-23 21:15     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 81+ messages in thread
From: Russell King - ARM Linux @ 2010-07-23 21:15 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-arm-kernel, Paul Walmsley, Tony Lindgren, janboe,
	linux-kernel, Santosh Shilimkar, Tomi Valkeinen, linux-omap

On Fri, Jul 23, 2010 at 09:58:30PM +0200, Uwe Kleine-König wrote:
> omapfb_reserve_sram() is only called by omap_detect_sram() which lives in
> .init.text.  So this is save for omapfb_reserve_sram(), too.

NAK.  (same reason.)

^ permalink raw reply	[flat|nested] 81+ messages in thread

* Re: [PATCH 07/11] ARM: omap: move omapfb_reserve_sram() to .init.text
@ 2010-07-23 21:15     ` Russell King - ARM Linux
  0 siblings, 0 replies; 81+ messages in thread
From: Russell King - ARM Linux @ 2010-07-23 21:15 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Paul Walmsley, Tony Lindgren, janboe, linux-kernel,
	Santosh Shilimkar, Tomi Valkeinen, linux-omap, linux-arm-kernel

On Fri, Jul 23, 2010 at 09:58:30PM +0200, Uwe Kleine-König wrote:
> omapfb_reserve_sram() is only called by omap_detect_sram() which lives in
> .init.text.  So this is save for omapfb_reserve_sram(), too.

NAK.  (same reason.)

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 07/11] ARM: omap: move omapfb_reserve_sram() to .init.text
@ 2010-07-23 21:15     ` Russell King - ARM Linux
  0 siblings, 0 replies; 81+ messages in thread
From: Russell King - ARM Linux @ 2010-07-23 21:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 23, 2010 at 09:58:30PM +0200, Uwe Kleine-K?nig wrote:
> omapfb_reserve_sram() is only called by omap_detect_sram() which lives in
> .init.text.  So this is save for omapfb_reserve_sram(), too.

NAK.  (same reason.)

^ permalink raw reply	[flat|nested] 81+ messages in thread

* Re: [PATCH 08/11] ARM: omap: move get_fbmem_region() to .init.text
  2010-07-23 19:58   ` Uwe Kleine-König
  (?)
@ 2010-07-23 21:16     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 81+ messages in thread
From: Russell King - ARM Linux @ 2010-07-23 21:16 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-arm-kernel, Tony Lindgren, linux-kernel, Tomi Valkeinen,
	linux-omap

On Fri, Jul 23, 2010 at 09:58:31PM +0200, Uwe Kleine-König wrote:
> get_fbmem_region() is only called by omapfb_reserve_sdram() and
> omapfb_reserve_sram() that both live in .init.text.  So get_fbmem_region
> can go there, too.

NAK.

^ permalink raw reply	[flat|nested] 81+ messages in thread

* Re: [PATCH 08/11] ARM: omap: move get_fbmem_region() to .init.text
@ 2010-07-23 21:16     ` Russell King - ARM Linux
  0 siblings, 0 replies; 81+ messages in thread
From: Russell King - ARM Linux @ 2010-07-23 21:16 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Tony Lindgren, Tomi Valkeinen, linux-omap, linux-kernel,
	linux-arm-kernel

On Fri, Jul 23, 2010 at 09:58:31PM +0200, Uwe Kleine-König wrote:
> get_fbmem_region() is only called by omapfb_reserve_sdram() and
> omapfb_reserve_sram() that both live in .init.text.  So get_fbmem_region
> can go there, too.

NAK.

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 08/11] ARM: omap: move get_fbmem_region() to .init.text
@ 2010-07-23 21:16     ` Russell King - ARM Linux
  0 siblings, 0 replies; 81+ messages in thread
From: Russell King - ARM Linux @ 2010-07-23 21:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 23, 2010 at 09:58:31PM +0200, Uwe Kleine-K?nig wrote:
> get_fbmem_region() is only called by omapfb_reserve_sdram() and
> omapfb_reserve_sram() that both live in .init.text.  So get_fbmem_region
> can go there, too.

NAK.

^ permalink raw reply	[flat|nested] 81+ messages in thread

* Re: [PATCH 02/11] ARM: kirkwood: move qnap_tsx1x_register_flash() to .init.text
  2010-07-23 19:58   ` Uwe Kleine-König
@ 2010-07-24  2:37     ` Nicolas Pitre
  -1 siblings, 0 replies; 81+ messages in thread
From: Nicolas Pitre @ 2010-07-24  2:37 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-arm-kernel, Lennert Buytenhek, Russell King,
	Martin Michlmayr, linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1957 bytes --]

On Fri, 23 Jul 2010, Uwe Kleine-König wrote:

> qnap_tsx1x_register_flash is only called by qnap_ts219_init and
> qnap_ts41x_init which both live in .init.text, too.  So the move is OK.
> 
> This fixes the following warning in kirkwood_defconfig:
> 	WARNING: vmlinux.o(.text+0x9334): Section mismatch in reference from the function qnap_tsx1x_register_flash() to the variable .init.data:qnap_tsx1x_spi_slave_info
> 	The function qnap_tsx1x_register_flash() references
> 	the variable __initdata qnap_tsx1x_spi_slave_info.
> 	This is often because qnap_tsx1x_register_flash lacks a __initdata
> 	annotation or the annotation of qnap_tsx1x_spi_slave_info is wrong.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

ACK.  You may send to RMK's patch system.



> ---
>  arch/arm/mach-kirkwood/tsx1x-common.c |    2 +-
>  arch/arm/mach-kirkwood/tsx1x-common.h |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-kirkwood/tsx1x-common.c b/arch/arm/mach-kirkwood/tsx1x-common.c
> index 7221c20..f781164 100644
> --- a/arch/arm/mach-kirkwood/tsx1x-common.c
> +++ b/arch/arm/mach-kirkwood/tsx1x-common.c
> @@ -77,7 +77,7 @@ struct spi_board_info __initdata qnap_tsx1x_spi_slave_info[] = {
>  	},
>  };
>  
> -void qnap_tsx1x_register_flash(void)
> +void __init qnap_tsx1x_register_flash(void)
>  {
>  	spi_register_board_info(qnap_tsx1x_spi_slave_info,
>  				ARRAY_SIZE(qnap_tsx1x_spi_slave_info));
> diff --git a/arch/arm/mach-kirkwood/tsx1x-common.h b/arch/arm/mach-kirkwood/tsx1x-common.h
> index 9a59296..7fa0373 100644
> --- a/arch/arm/mach-kirkwood/tsx1x-common.h
> +++ b/arch/arm/mach-kirkwood/tsx1x-common.h
> @@ -1,7 +1,7 @@
>  #ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H
>  #define __ARCH_KIRKWOOD_TSX1X_COMMON_H
>  
> -extern void qnap_tsx1x_register_flash(void);
> +extern void __init qnap_tsx1x_register_flash(void);
>  extern void qnap_tsx1x_power_off(void);
>  
>  #endif
> -- 
> 1.7.1
> 

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 02/11] ARM: kirkwood: move qnap_tsx1x_register_flash() to .init.text
@ 2010-07-24  2:37     ` Nicolas Pitre
  0 siblings, 0 replies; 81+ messages in thread
From: Nicolas Pitre @ 2010-07-24  2:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 23 Jul 2010, Uwe Kleine-K?nig wrote:

> qnap_tsx1x_register_flash is only called by qnap_ts219_init and
> qnap_ts41x_init which both live in .init.text, too.  So the move is OK.
> 
> This fixes the following warning in kirkwood_defconfig:
> 	WARNING: vmlinux.o(.text+0x9334): Section mismatch in reference from the function qnap_tsx1x_register_flash() to the variable .init.data:qnap_tsx1x_spi_slave_info
> 	The function qnap_tsx1x_register_flash() references
> 	the variable __initdata qnap_tsx1x_spi_slave_info.
> 	This is often because qnap_tsx1x_register_flash lacks a __initdata
> 	annotation or the annotation of qnap_tsx1x_spi_slave_info is wrong.
> 
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

ACK.  You may send to RMK's patch system.



> ---
>  arch/arm/mach-kirkwood/tsx1x-common.c |    2 +-
>  arch/arm/mach-kirkwood/tsx1x-common.h |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-kirkwood/tsx1x-common.c b/arch/arm/mach-kirkwood/tsx1x-common.c
> index 7221c20..f781164 100644
> --- a/arch/arm/mach-kirkwood/tsx1x-common.c
> +++ b/arch/arm/mach-kirkwood/tsx1x-common.c
> @@ -77,7 +77,7 @@ struct spi_board_info __initdata qnap_tsx1x_spi_slave_info[] = {
>  	},
>  };
>  
> -void qnap_tsx1x_register_flash(void)
> +void __init qnap_tsx1x_register_flash(void)
>  {
>  	spi_register_board_info(qnap_tsx1x_spi_slave_info,
>  				ARRAY_SIZE(qnap_tsx1x_spi_slave_info));
> diff --git a/arch/arm/mach-kirkwood/tsx1x-common.h b/arch/arm/mach-kirkwood/tsx1x-common.h
> index 9a59296..7fa0373 100644
> --- a/arch/arm/mach-kirkwood/tsx1x-common.h
> +++ b/arch/arm/mach-kirkwood/tsx1x-common.h
> @@ -1,7 +1,7 @@
>  #ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H
>  #define __ARCH_KIRKWOOD_TSX1X_COMMON_H
>  
> -extern void qnap_tsx1x_register_flash(void);
> +extern void __init qnap_tsx1x_register_flash(void);
>  extern void qnap_tsx1x_power_off(void);
>  
>  #endif
> -- 
> 1.7.1
> 

^ permalink raw reply	[flat|nested] 81+ messages in thread

* Re: [PATCH 06/11] ARM: omap: move omapfb_reserve_sdram() to .init.text
  2010-07-23 21:15     ` Russell King - ARM Linux
@ 2010-07-24  8:51       ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-24  8:51 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-arm-kernel, Tony Lindgren, linux-kernel, Tomi Valkeinen,
	linux-omap

On Fri, Jul 23, 2010 at 10:15:35PM +0100, Russell King - ARM Linux wrote:
> On Fri, Jul 23, 2010 at 09:58:29PM +0200, Uwe Kleine-König wrote:
> > omapfb_reserve_sdram() is only called by omap1_map_common_io() and
> > _omap2_map_common_io() that both live in .init.text.  So this is save
> > for omapfb_reserve_sdram(), too.
> 
> NAK.  This clashes with the memblock stuff.
OK, I will recheck after .36-rc1.

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 06/11] ARM: omap: move omapfb_reserve_sdram() to .init.text
@ 2010-07-24  8:51       ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-07-24  8:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 23, 2010 at 10:15:35PM +0100, Russell King - ARM Linux wrote:
> On Fri, Jul 23, 2010 at 09:58:29PM +0200, Uwe Kleine-K?nig wrote:
> > omapfb_reserve_sdram() is only called by omap1_map_common_io() and
> > _omap2_map_common_io() that both live in .init.text.  So this is save
> > for omapfb_reserve_sdram(), too.
> 
> NAK.  This clashes with the memblock stuff.
OK, I will recheck after .36-rc1.

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 81+ messages in thread

* Re: [PATCH 01/11] ARM: cam60: move cam60_spi_devices to .init.data
  2010-07-23 19:58 ` Uwe Kleine-König
@ 2010-08-01 21:23   ` avictor.za at gmail.com
  -1 siblings, 0 replies; 81+ messages in thread
From: avictor.za @ 2010-08-01 21:23 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-arm-kernel, Russell King, Samuel R. C. Vale, Jiri Kosina,
	Andrew Victor, linux-kernel

hi,

> cam60_spi_devices is passed to at91_add_device_spi which calls
> spi_register_board_info.  The latter makes a copy of it, so living in
> .init.data is OK.

The  copy still maintains a pointers to
"cam60_spi_flash_platform_data", so I'm wondering if that and
"cam60_spi_partitions" should maybe not be marked as __initdata.


Regards,
  Andrew Victor



> ---
>  arch/arm/mach-at91/board-cam60.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
> index 02138af..05c7072 100644
> --- a/arch/arm/mach-at91/board-cam60.c
> +++ b/arch/arm/mach-at91/board-cam60.c
> @@ -98,14 +98,14 @@ static struct mtd_partition __initdata cam60_spi_partitions[] = {
>        },
>  };
>
> -static struct flash_platform_data __initdata cam60_spi_flash_platform_data = {
> +static struct flash_platform_data cam60_spi_flash_platform_data __initdata = {
>        .name           = "spi_flash",
>        .parts          = cam60_spi_partitions,
>        .nr_parts       = ARRAY_SIZE(cam60_spi_partitions)
>  };
>  #endif
>
> -static struct spi_board_info cam60_spi_devices[] = {
> +static struct spi_board_info cam60_spi_devices[] __initdata = {
>  #if defined(CONFIG_MTD_DATAFLASH)
>        {       /* DataFlash chip */
>                .modalias       = "mtd_dataflash",

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 01/11] ARM: cam60: move cam60_spi_devices to .init.data
@ 2010-08-01 21:23   ` avictor.za at gmail.com
  0 siblings, 0 replies; 81+ messages in thread
From: avictor.za at gmail.com @ 2010-08-01 21:23 UTC (permalink / raw)
  To: linux-arm-kernel

hi,

> cam60_spi_devices is passed to at91_add_device_spi which calls
> spi_register_board_info. ?The latter makes a copy of it, so living in
> .init.data is OK.

The  copy still maintains a pointers to
"cam60_spi_flash_platform_data", so I'm wondering if that and
"cam60_spi_partitions" should maybe not be marked as __initdata.


Regards,
  Andrew Victor



> ---
> ?arch/arm/mach-at91/board-cam60.c | ? ?4 ++--
> ?1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
> index 02138af..05c7072 100644
> --- a/arch/arm/mach-at91/board-cam60.c
> +++ b/arch/arm/mach-at91/board-cam60.c
> @@ -98,14 +98,14 @@ static struct mtd_partition __initdata cam60_spi_partitions[] = {
> ? ? ? ?},
> ?};
>
> -static struct flash_platform_data __initdata cam60_spi_flash_platform_data = {
> +static struct flash_platform_data cam60_spi_flash_platform_data __initdata = {
> ? ? ? ?.name ? ? ? ? ? = "spi_flash",
> ? ? ? ?.parts ? ? ? ? ?= cam60_spi_partitions,
> ? ? ? ?.nr_parts ? ? ? = ARRAY_SIZE(cam60_spi_partitions)
> ?};
> ?#endif
>
> -static struct spi_board_info cam60_spi_devices[] = {
> +static struct spi_board_info cam60_spi_devices[] __initdata = {
> ?#if defined(CONFIG_MTD_DATAFLASH)
> ? ? ? ?{ ? ? ? /* DataFlash chip */
> ? ? ? ? ? ? ? ?.modalias ? ? ? = "mtd_dataflash",

^ permalink raw reply	[flat|nested] 81+ messages in thread

* Re: [PATCH 01/11] ARM: cam60: move cam60_spi_devices to .init.data
  2010-08-01 21:23   ` avictor.za at gmail.com
@ 2010-08-02  5:26     ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-02  5:26 UTC (permalink / raw)
  To: avictor.za
  Cc: linux-arm-kernel, Russell King, Samuel R. C. Vale, Jiri Kosina,
	Andrew Victor, linux-kernel

Hi Andrew,

On Sun, Aug 01, 2010 at 11:23:35PM +0200, avictor.za@gmail.com wrote:
> > cam60_spi_devices is passed to at91_add_device_spi which calls
> > spi_register_board_info.  The latter makes a copy of it, so living in
> > .init.data is OK.
> 
> The  copy still maintains a pointers to
> "cam60_spi_flash_platform_data", so I'm wondering if that and
> "cam60_spi_partitions" should maybe not be marked as __initdata.
I think that's right, these need to be fixed up.  Thanks for noticing, I
will prepare a patch later today.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 01/11] ARM: cam60: move cam60_spi_devices to .init.data
@ 2010-08-02  5:26     ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-02  5:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Andrew,

On Sun, Aug 01, 2010 at 11:23:35PM +0200, avictor.za at gmail.com wrote:
> > cam60_spi_devices is passed to at91_add_device_spi which calls
> > spi_register_board_info. ?The latter makes a copy of it, so living in
> > .init.data is OK.
> 
> The  copy still maintains a pointers to
> "cam60_spi_flash_platform_data", so I'm wondering if that and
> "cam60_spi_partitions" should maybe not be marked as __initdata.
I think that's right, these need to be fixed up.  Thanks for noticing, I
will prepare a patch later today.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH] ARM: cam60: don't use __init for cam60_spi_{flash_platform_data, partitions}
  2010-08-02  5:26     ` Uwe Kleine-König
  (?)
@ 2010-08-02  7:59     ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-02  7:59 UTC (permalink / raw)
  To: linux-arm-kernel

These two structs are referenced by cam60_spi_devices.  The latter is
copied at init time to kmalloced memory and so the copy isn't freed after
booting.  So it must not contain references to .init memory.

This isn't noticed by modpost as cam60_spi_devices is in .init.data, too.

Noticed-by: Andrew Victor <avictor.za@gmail.com>
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-at91/board-cam60.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
index 05c7072..44eb9f7 100644
--- a/arch/arm/mach-at91/board-cam60.c
+++ b/arch/arm/mach-at91/board-cam60.c
@@ -75,7 +75,7 @@ static struct at91_usbh_data __initdata cam60_usbh_data = {
  * SPI devices.
  */
 #if defined(CONFIG_MTD_DATAFLASH)
-static struct mtd_partition __initdata cam60_spi_partitions[] = {
+static struct mtd_partition cam60_spi_partitions[] = {
 	{
 		.name	= "BOOT1",
 		.offset	= 0,
@@ -98,7 +98,7 @@ static struct mtd_partition __initdata cam60_spi_partitions[] = {
 	},
 };
 
-static struct flash_platform_data cam60_spi_flash_platform_data __initdata = {
+static struct flash_platform_data cam60_spi_flash_platform_data = {
 	.name		= "spi_flash",
 	.parts		= cam60_spi_partitions,
 	.nr_parts	= ARRAY_SIZE(cam60_spi_partitions)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 00/19] More section fixes [Was: Re: [PATCH 01/11] ARM: cam60: move cam60_spi_devices to .init.data]
  2010-07-23 19:58 ` Uwe Kleine-König
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Russell King, Jiri Kosina, linux-kernel, Samuel R. C. Vale,
	Andrew Victor

Hello,

I updated the series and added a few more fixes.  The usb-fixes were
already sent to linux-usb ML, the others are new.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 00/19] More section fixes [Was: Re: [PATCH 01/11] ARM: cam60: move cam60_spi_devices to .init.data]
@ 2010-08-05 14:08   ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

I updated the series and added a few more fixes.  The usb-fixes were
already sent to linux-usb ML, the others are new.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 01/19] wip: enable DEBUG_SECTION_MISMATCH
  2010-08-05 14:08   ` Uwe Kleine-König
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

---
 lib/Kconfig.debug |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index dfdc034..a73e004 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -103,7 +103,7 @@ config HEADERS_CHECK
 
 config DEBUG_SECTION_MISMATCH
 	bool "Enable full Section mismatch analysis"
-	depends on UNDEFINED || (BLACKFIN)
+	depends on BLACKFIN || ARM
 	default y
 	# This option is on purpose disabled for now.
 	# It will be enabled when we are down to a reasonable number
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 02/19] ARM: sa1111: move __sa1111_probe() to .devinit.text
  2010-08-05 14:08   ` Uwe Kleine-König
  (?)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  2010-09-01 10:02     ` Uwe Kleine-König
  -1 siblings, 1 reply; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

__sa1111_probe is only called by sa1111_probe that lives in .devinit.text.
So it's save to move the former to .devinit.text, too.

Acked-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/common/sa1111.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 517d50d..c0258a8 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -678,7 +678,7 @@ out:
  *	%-EBUSY		physical address already marked in-use.
  *	%0		successful.
  */
-static int
+static int __devinit
 __sa1111_probe(struct device *me, struct resource *mem, int irq)
 {
 	struct sa1111 *sachip;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 03/19] ARM: omap: move omap_init_fb to .init.text
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (2 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

omap_init_fb() is only called as arch_initcall and so can live in
.init.text.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index 0054b95..a727133 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -336,7 +336,7 @@ void omapfb_set_ctrl_platform_data(void *data)
 	omapfb_config.ctrl_platform_data = data;
 }
 
-static inline int omap_init_fb(void)
+static int __init omap_init_fb(void)
 {
 	const struct omap_lcd_config *conf;
 
@@ -381,7 +381,7 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
 	omapfb_config = *data;
 }
 
-static inline int omap_init_fb(void)
+static int __init omap_init_fb(void)
 {
 	return platform_device_register(&omap_fb_device);
 }
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 04/19] ARM: omap1: nokia770: move mipid_dev_init() to .init.text
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (3 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

mipid_dev_init() is only called by omap_nokia770_init that lives in
.init.text.  So it's save to move the former to .init.text, too.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-omap1/board-nokia770.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 8c28b10..37d78da 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -113,7 +113,7 @@ static struct mipid_platform_data nokia770_mipid_platform_data = {
 	.shutdown = mipid_shutdown,
 };
 
-static void mipid_dev_init(void)
+static void __init mipid_dev_init(void)
 {
 	const struct omap_lcd_config *conf;
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 05/19] ARM: omap: move get_fbmem_region() to .init.text
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (4 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

get_fbmem_region() is only called by omapfb_reserve_sdram_memblock() and
omapfb_reserve_sram() that both live in .init.text.  So get_fbmem_region
can go there, too.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index a727133..6522f27 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -94,7 +94,7 @@ static int fbmem_region_reserved(unsigned long start, size_t size)
  * Get the region_idx`th region from board config/ATAG and convert it to
  * our internal format.
  */
-static int get_fbmem_region(int region_idx, struct omapfb_mem_region *rg)
+static int __init get_fbmem_region(int region_idx, struct omapfb_mem_region *rg)
 {
 	const struct omap_fbmem_config	*conf;
 	u32				paddr;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 06/19] ARM: omap: move omap_get_config et al. to .init.text
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (5 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

All callers of these functions live in .init.text, so these can go there,
too.  There they must not be exported anymore, this is no problem though,
as all callers are always built-in.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-omap/common.c             |    6 ++----
 arch/arm/plat-omap/include/plat/board.h |    4 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index ebed826..9cd4d91 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -71,17 +71,15 @@ static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
 	return kinfo->data;
 }
 
-const void *__omap_get_config(u16 tag, size_t len, int nr)
+const void *__init __omap_get_config(u16 tag, size_t len, int nr)
 {
         return get_config(tag, len, nr, NULL);
 }
-EXPORT_SYMBOL(__omap_get_config);
 
-const void *omap_get_var_config(u16 tag, size_t *len)
+const void *__init omap_get_var_config(u16 tag, size_t *len)
 {
         return get_config(tag, NO_LENGTH_CHECK, 0, len);
 }
-EXPORT_SYMBOL(omap_get_var_config);
 
 void __init omap_reserve(void)
 {
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
index 5cd6220..7decf58 100644
--- a/arch/arm/plat-omap/include/plat/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -143,14 +143,14 @@ struct omap_board_config_kernel {
 	const void *data;
 };
 
-extern const void *__omap_get_config(u16 tag, size_t len, int nr);
+extern const void *__init __omap_get_config(u16 tag, size_t len, int nr);
 
 #define omap_get_config(tag, type) \
 	((const type *) __omap_get_config((tag), sizeof(type), 0))
 #define omap_get_nr_config(tag, type, nr) \
 	((const type *) __omap_get_config((tag), sizeof(type), (nr)))
 
-extern const void *omap_get_var_config(u16 tag, size_t *len);
+extern const void *__init omap_get_var_config(u16 tag, size_t *len);
 
 extern struct omap_board_config_kernel *omap_board_config;
 extern int omap_board_config_size;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 07/19] wip: ARM: omap: move omap_board_config_kernel to .init.data
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (6 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

Probably this works ...
---
 arch/arm/plat-omap/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 9cd4d91..b985cdc 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -46,7 +46,7 @@
 
 #define NO_LENGTH_CHECK 0xffffffff
 
-struct omap_board_config_kernel *omap_board_config;
+struct omap_board_config_kernel *omap_board_config __initdata;
 int omap_board_config_size;
 
 static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 08/19] ARM: omap: ams-delta: move config to .init.data
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (7 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

Most other boards have their config in .init.data, too, so this should
be OK.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-omap1/board-ams-delta.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 0a9d61d..71353f9 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -173,7 +173,7 @@ static struct omap_usb_config ams_delta_usb_config __initdata = {
 	.pins[0]	= 2,
 };
 
-static struct omap_board_config_kernel ams_delta_config[] = {
+static struct omap_board_config_kernel ams_delta_config[] __initdata = {
 	{ OMAP_TAG_LCD,		&ams_delta_lcd_config },
 };
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 09/19] MTD: pxa2xx: move pxa2xx_flash_probe to .devinit.text
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (8 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

This fixes the following warning by modpost:

	WARNING: vmlinux.o(.data+0x15018): Section mismatch in reference from the variable pxa2xx_flash_driver to the function .init.text:pxa2xx_flash_probe()
	The variable pxa2xx_flash_driver references
	the function __init pxa2xx_flash_probe()
	If the reference is valid then annotate the
	variable with __init* or __refdata (see linux/init.h) or name the variable:
	*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

I choosed to do this instead of using platform_driver_probe as the remove
function uses __devexit.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 drivers/mtd/maps/pxa2xx-flash.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
index dd90880..d8ae634 100644
--- a/drivers/mtd/maps/pxa2xx-flash.c
+++ b/drivers/mtd/maps/pxa2xx-flash.c
@@ -51,7 +51,7 @@ struct pxa2xx_flash_info {
 static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
 
 
-static int __init pxa2xx_flash_probe(struct platform_device *pdev)
+static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
 {
 	struct flash_platform_data *flash = pdev->dev.platform_data;
 	struct pxa2xx_flash_info *info;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 10/19] VIDEO: sa1100fb: register driver using platform_driver_probe
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (9 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

This fixes

	WARNING: vmlinux.o(.devinit.text+0x364): Section mismatch in reference from the function sa1100fb_probe() to the function .init.text:sa1100fb_init_fbinfo()
	The function __devinit sa1100fb_probe() references
	a function __init sa1100fb_init_fbinfo().
	If sa1100fb_init_fbinfo is only used by sa1100fb_probe then
	annotate sa1100fb_init_fbinfo with a matching annotation.

Commit c2e13037e6794bd0d9de3f9ecabf5615f15c160b addressed a section
mismatch in this driver but introduced new ones as sa1100fb_probe
references many more .init variables and functions (some of them
indirectly) so using platform_driver_probe is less intrusive.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 drivers/video/sa1100fb.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index e8b76d6..35fc741 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -1351,7 +1351,6 @@ static struct fb_monspecs monspecs __initdata = {
 	.vfmax	= 65,
 };
 
-
 static struct sa1100fb_info * __init sa1100fb_init_fbinfo(struct device *dev)
 {
 	struct sa1100fb_mach_info *inf;
@@ -1435,7 +1434,7 @@ static struct sa1100fb_info * __init sa1100fb_init_fbinfo(struct device *dev)
 	return fbi;
 }
 
-static int __devinit sa1100fb_probe(struct platform_device *pdev)
+static int __init sa1100fb_probe(struct platform_device *pdev)
 {
 	struct sa1100fb_info *fbi;
 	int ret, irq;
@@ -1501,7 +1500,6 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev)
 }
 
 static struct platform_driver sa1100fb_driver = {
-	.probe		= sa1100fb_probe,
 	.suspend	= sa1100fb_suspend,
 	.resume		= sa1100fb_resume,
 	.driver		= {
@@ -1514,7 +1512,7 @@ int __init sa1100fb_init(void)
 	if (fb_get_options("sa1100fb", NULL))
 		return -ENODEV;
 
-	return platform_driver_register(&sa1100fb_driver);
+	return platform_driver_probe(&sa1100fb_driver, sa1100fb_probe);
 }
 
 int __init sa1100fb_setup(char *options)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 11/19] ARM: cam60: move cam60_spi_devices to .init.data
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (10 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  2010-08-10 19:33     ` avictor.za at gmail.com
  -1 siblings, 1 reply; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

cam60_spi_devices is passed to at91_add_device_spi which calls
spi_register_board_info.  The latter makes a copy of it, so living in
.init.data is OK.

This fixes the following warning in cam60_defconfig:
	WARNING: vmlinux.o(.data+0x2a00): Section mismatch in reference from the variable cam60_spi_devices to the (unknown reference) .init.data:(unknown)
	The variable cam60_spi_devices references
	the (unknown reference) __initdata (unknown)
	If the reference is valid then annotate the
	variable with __init* or __refdata (see linux/init.h) or name the variable:
	*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-at91/board-cam60.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
index 02138af..05c7072 100644
--- a/arch/arm/mach-at91/board-cam60.c
+++ b/arch/arm/mach-at91/board-cam60.c
@@ -98,14 +98,14 @@ static struct mtd_partition __initdata cam60_spi_partitions[] = {
 	},
 };
 
-static struct flash_platform_data __initdata cam60_spi_flash_platform_data = {
+static struct flash_platform_data cam60_spi_flash_platform_data __initdata = {
 	.name		= "spi_flash",
 	.parts		= cam60_spi_partitions,
 	.nr_parts	= ARRAY_SIZE(cam60_spi_partitions)
 };
 #endif
 
-static struct spi_board_info cam60_spi_devices[] = {
+static struct spi_board_info cam60_spi_devices[] __initdata = {
 #if defined(CONFIG_MTD_DATAFLASH)
 	{	/* DataFlash chip */
 		.modalias	= "mtd_dataflash",
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 12/19] ARM: cam60: don't use __init for cam60_spi_{flash_platform_data, partitions}
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (11 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  2010-08-10 19:37     ` avictor.za at gmail.com
  -1 siblings, 1 reply; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

These two structs are referenced by cam60_spi_devices.  The latter is
copied at init time to kmalloced memory and so the copy isn't freed after
booting.  So it must not contain references to .init memory.

This isn't noticed by modpost as cam60_spi_devices is in .init.data, too.

Noticed-by: Andrew Victor <avictor.za@gmail.com>
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-at91/board-cam60.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
index 05c7072..44eb9f7 100644
--- a/arch/arm/mach-at91/board-cam60.c
+++ b/arch/arm/mach-at91/board-cam60.c
@@ -75,7 +75,7 @@ static struct at91_usbh_data __initdata cam60_usbh_data = {
  * SPI devices.
  */
 #if defined(CONFIG_MTD_DATAFLASH)
-static struct mtd_partition __initdata cam60_spi_partitions[] = {
+static struct mtd_partition cam60_spi_partitions[] = {
 	{
 		.name	= "BOOT1",
 		.offset	= 0,
@@ -98,7 +98,7 @@ static struct mtd_partition __initdata cam60_spi_partitions[] = {
 	},
 };
 
-static struct flash_platform_data cam60_spi_flash_platform_data __initdata = {
+static struct flash_platform_data cam60_spi_flash_platform_data = {
 	.name		= "spi_flash",
 	.parts		= cam60_spi_partitions,
 	.nr_parts	= ARRAY_SIZE(cam60_spi_partitions)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 13/19] usb gadget: don't save bind callback in struct usb_gadget_driver
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (12 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

To accomplish this the function to register a gadget driver takes the bind
function as a second argument.  To make things clearer rename the function
to resemble platform_driver_probe.

This fixes many section mismatches like

	WARNING: drivers/usb/gadget/g_printer.o(.data+0xc): Section mismatch in
	reference from the variable printer_driver to the function
	.init.text:printer_bind()
	The variable printer_driver references
	the function __init printer_bind()

All callers are fixed.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Micha? Nazarewicz <m.nazarewicz@samsung.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/gadget/amd5536udc.c     |    9 +++++----
 drivers/usb/gadget/at91_udc.c       |   11 ++++++-----
 drivers/usb/gadget/atmel_usba_udc.c |    7 ++++---
 drivers/usb/gadget/ci13xxx_udc.c    |   18 ++++++++++--------
 drivers/usb/gadget/composite.c      |    3 +--
 drivers/usb/gadget/dummy_hcd.c      |   10 +++++-----
 drivers/usb/gadget/file_storage.c   |    3 +--
 drivers/usb/gadget/fsl_qe_udc.c     |   12 ++++++------
 drivers/usb/gadget/fsl_udc_core.c   |   10 +++++-----
 drivers/usb/gadget/gmidi.c          |    3 +--
 drivers/usb/gadget/goku_udc.c       |    9 +++++----
 drivers/usb/gadget/imx_udc.c        |    9 +++++----
 drivers/usb/gadget/inode.c          |    6 ++----
 drivers/usb/gadget/langwell_udc.c   |    9 +++++----
 drivers/usb/gadget/lh7a40x_udc.c    |   10 +++++-----
 drivers/usb/gadget/m66592-udc.c     |    9 +++++----
 drivers/usb/gadget/net2280.c        |   10 +++++-----
 drivers/usb/gadget/omap_udc.c       |   10 +++++-----
 drivers/usb/gadget/printer.c        |    5 ++---
 drivers/usb/gadget/pxa25x_udc.c     |    9 +++++----
 drivers/usb/gadget/pxa27x_udc.c     |   12 +++++++-----
 drivers/usb/gadget/r8a66597-udc.c   |    9 +++++----
 drivers/usb/gadget/s3c-hsotg.c      |    9 +++++----
 drivers/usb/gadget/s3c2410_udc.c    |   17 ++++++++---------
 drivers/usb/musb/musb_gadget.c      |    9 +++++----
 include/linux/usb/gadget.h          |   20 ++++++++------------
 26 files changed, 126 insertions(+), 122 deletions(-)

diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 731150d..fadebfd 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -1954,13 +1954,14 @@ static int setup_ep0(struct udc *dev)
 }
 
 /* Called by gadget driver to register itself */
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct udc		*dev = udc;
 	int			retval;
 	u32 tmp;
 
-	if (!driver || !driver->bind || !driver->setup
+	if (!driver || !bind || !driver->setup
 			|| driver->speed != USB_SPEED_HIGH)
 		return -EINVAL;
 	if (!dev)
@@ -1972,7 +1973,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	dev->driver = driver;
 	dev->gadget.dev.driver = &driver->driver;
 
-	retval = driver->bind(&dev->gadget);
+	retval = bind(&dev->gadget);
 
 	/* Some gadget drivers use both ep0 directions.
 	 * NOTE: to gadget driver, ep0 is just one endpoint...
@@ -2000,7 +2001,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 
 	return 0;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 /* shutdown requests and disconnect from gadget */
 static void
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 93ead19..387e503 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1628,7 +1628,8 @@ static void at91_vbus_timer(unsigned long data)
 		schedule_work(&udc->vbus_timer_work);
 }
 
-int usb_gadget_register_driver (struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct at91_udc	*udc = &controller;
 	int		retval;
@@ -1636,7 +1637,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
 
 	if (!driver
 			|| driver->speed < USB_SPEED_FULL
-			|| !driver->bind
+			|| !bind
 			|| !driver->setup) {
 		DBG("bad parameter.\n");
 		return -EINVAL;
@@ -1653,9 +1654,9 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
 	udc->enabled = 1;
 	udc->selfpowered = 1;
 
-	retval = driver->bind(&udc->gadget);
+	retval = bind(&udc->gadget);
 	if (retval) {
-		DBG("driver->bind() returned %d\n", retval);
+		DBG("bind() returned %d\n", retval);
 		udc->driver = NULL;
 		udc->gadget.dev.driver = NULL;
 		dev_set_drvdata(&udc->gadget.dev, NULL);
@@ -1671,7 +1672,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
 	DBG("bound to %s\n", driver->driver.name);
 	return 0;
 }
-EXPORT_SYMBOL (usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
 {
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index d623c7b..e4810c6 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1789,7 +1789,8 @@ out:
 	return IRQ_HANDLED;
 }
 
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct usba_udc *udc = &the_udc;
 	unsigned long flags;
@@ -1812,7 +1813,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	clk_enable(udc->pclk);
 	clk_enable(udc->hclk);
 
-	ret = driver->bind(&udc->gadget);
+	ret = bind(&udc->gadget);
 	if (ret) {
 		DBG(DBG_ERR, "Could not bind to driver %s: error %d\n",
 			driver->driver.name, ret);
@@ -1841,7 +1842,7 @@ err_driver_bind:
 	udc->gadget.dev.driver = NULL;
 	return ret;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 {
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c
index 6996951..98b36fc 100644
--- a/drivers/usb/gadget/ci13xxx_udc.c
+++ b/drivers/usb/gadget/ci13xxx_udc.c
@@ -2340,12 +2340,15 @@ static const struct usb_ep_ops usb_ep_ops = {
 static const struct usb_gadget_ops usb_gadget_ops;
 
 /**
- * usb_gadget_register_driver: register a gadget driver
+ * usb_gadget_probe_driver: register a gadget driver
+ * @driver: the driver being registered
+ * @bind: the driver's bind callback
  *
- * Check usb_gadget_register_driver() at "usb_gadget.h" for details
- * Interrupts are enabled here
+ * Check usb_gadget_probe_driver() at <linux/usb/gadget.h> for details.
+ * Interrupts are enabled here.
  */
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct ci13xxx *udc = _udc;
 	unsigned long i, k, flags;
@@ -2354,7 +2357,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	trace("%p", driver);
 
 	if (driver             == NULL ||
-	    driver->bind       == NULL ||
+	    bind               == NULL ||
 	    driver->unbind     == NULL ||
 	    driver->setup      == NULL ||
 	    driver->disconnect == NULL ||
@@ -2430,7 +2433,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	udc->gadget.dev.driver = &driver->driver;
 
 	spin_unlock_irqrestore(udc->lock, flags);
-	retval = driver->bind(&udc->gadget);                /* MAY SLEEP */
+	retval = bind(&udc->gadget);                /* MAY SLEEP */
 	spin_lock_irqsave(udc->lock, flags);
 
 	if (retval) {
@@ -2447,7 +2450,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 		usb_gadget_unregister_driver(driver);
 	return retval;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 /**
  * usb_gadget_unregister_driver: unregister a gadget driver
@@ -2462,7 +2465,6 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 	trace("%p", driver);
 
 	if (driver             == NULL ||
-	    driver->bind       == NULL ||
 	    driver->unbind     == NULL ||
 	    driver->setup      == NULL ||
 	    driver->disconnect == NULL ||
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 391d169..d07960e 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1112,7 +1112,6 @@ composite_resume(struct usb_gadget *gadget)
 static struct usb_gadget_driver composite_driver = {
 	.speed		= USB_SPEED_HIGH,
 
-	.bind		= composite_bind,
 	.unbind		= composite_unbind,
 
 	.setup		= composite_setup,
@@ -1152,7 +1151,7 @@ int usb_composite_register(struct usb_composite_driver *driver)
 	composite_driver.driver.name = driver->name;
 	composite = driver;
 
-	return usb_gadget_register_driver(&composite_driver);
+	return usb_gadget_probe_driver(&composite_driver, composite_bind);
 }
 
 /**
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 4f9e578..5860222 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -748,7 +748,8 @@ static DEVICE_ATTR (function, S_IRUGO, show_function, NULL);
  */
 
 int
-usb_gadget_register_driver (struct usb_gadget_driver *driver)
+usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct dummy	*dum = the_controller;
 	int		retval, i;
@@ -757,8 +758,7 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver)
 		return -EINVAL;
 	if (dum->driver)
 		return -EBUSY;
-	if (!driver->bind || !driver->setup
-			|| driver->speed == USB_SPEED_UNKNOWN)
+	if (!bind || !driver->setup || driver->speed == USB_SPEED_UNKNOWN)
 		return -EINVAL;
 
 	/*
@@ -796,7 +796,7 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver)
 	dum->gadget.dev.driver = &driver->driver;
 	dev_dbg (udc_dev(dum), "binding gadget driver '%s'\n",
 			driver->driver.name);
-	retval = driver->bind(&dum->gadget);
+	retval = bind(&dum->gadget);
 	if (retval) {
 		dum->driver = NULL;
 		dum->gadget.dev.driver = NULL;
@@ -812,7 +812,7 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver)
 	usb_hcd_poll_rh_status (dummy_to_hcd (dum));
 	return 0;
 }
-EXPORT_SYMBOL (usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 int
 usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index b49d86e..7c858ca 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -3541,7 +3541,6 @@ static struct usb_gadget_driver		fsg_driver = {
 	.speed		= USB_SPEED_FULL,
 #endif
 	.function	= (char *) fsg_string_product,
-	.bind		= fsg_bind,
 	.unbind		= fsg_unbind,
 	.disconnect	= fsg_disconnect,
 	.setup		= fsg_setup,
@@ -3583,7 +3582,7 @@ static int __init fsg_init(void)
 	if ((rc = fsg_alloc()) != 0)
 		return rc;
 	fsg = the_fsg;
-	if ((rc = usb_gadget_register_driver(&fsg_driver)) != 0)
+	if ((rc = usb_gadget_probe_driver(&fsg_driver, fsg_bind)) != 0)
 		kref_put(&fsg->ref, fsg_release);
 	return rc;
 }
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c
index 82506ca..9b4f4b5 100644
--- a/drivers/usb/gadget/fsl_qe_udc.c
+++ b/drivers/usb/gadget/fsl_qe_udc.c
@@ -2301,9 +2301,10 @@ static irqreturn_t qe_udc_irq(int irq, void *_udc)
 }
 
 /*-------------------------------------------------------------------------
-	Gadget driver register and unregister.
+	Gadget driver probe and unregister.
  --------------------------------------------------------------------------*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	int retval;
 	unsigned long flags = 0;
@@ -2314,8 +2315,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 
 	if (!driver || (driver->speed != USB_SPEED_FULL
 			&& driver->speed != USB_SPEED_HIGH)
-			|| !driver->bind || !driver->disconnect
-			|| !driver->setup)
+			|| !bind || !driver->disconnect || !driver->setup)
 		return -EINVAL;
 
 	if (udc_controller->driver)
@@ -2331,7 +2331,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	udc_controller->gadget.speed = (enum usb_device_speed)(driver->speed);
 	spin_unlock_irqrestore(&udc_controller->lock, flags);
 
-	retval = driver->bind(&udc_controller->gadget);
+	retval = bind(&udc_controller->gadget);
 	if (retval) {
 		dev_err(udc_controller->dev, "bind to %s --> %d",
 				driver->driver.name, retval);
@@ -2352,7 +2352,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 		udc_controller->gadget.name, driver->driver.name);
 	return 0;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 {
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index 08a9a62..c16b402 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -1765,7 +1765,8 @@ static irqreturn_t fsl_udc_irq(int irq, void *_udc)
  * Hook to gadget drivers
  * Called by initialization code of gadget drivers
 *----------------------------------------------------------------*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	int retval = -ENODEV;
 	unsigned long flags = 0;
@@ -1775,8 +1776,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 
 	if (!driver || (driver->speed != USB_SPEED_FULL
 				&& driver->speed != USB_SPEED_HIGH)
-			|| !driver->bind || !driver->disconnect
-			|| !driver->setup)
+			|| !bind || !driver->disconnect || !driver->setup)
 		return -EINVAL;
 
 	if (udc_controller->driver)
@@ -1792,7 +1792,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	spin_unlock_irqrestore(&udc_controller->lock, flags);
 
 	/* bind udc driver to gadget driver */
-	retval = driver->bind(&udc_controller->gadget);
+	retval = bind(&udc_controller->gadget);
 	if (retval) {
 		VDBG("bind to %s --> %d", driver->driver.name, retval);
 		udc_controller->gadget.dev.driver = NULL;
@@ -1814,7 +1814,7 @@ out:
 		       retval);
 	return retval;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 /* Disconnect from gadget driver */
 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c
index 2b56ce6..b33ee5d 100644
--- a/drivers/usb/gadget/gmidi.c
+++ b/drivers/usb/gadget/gmidi.c
@@ -1292,7 +1292,6 @@ static void gmidi_resume(struct usb_gadget *gadget)
 static struct usb_gadget_driver gmidi_driver = {
 	.speed		= USB_SPEED_FULL,
 	.function	= (char *)longname,
-	.bind		= gmidi_bind,
 	.unbind		= gmidi_unbind,
 
 	.setup		= gmidi_setup,
@@ -1309,7 +1308,7 @@ static struct usb_gadget_driver gmidi_driver = {
 
 static int __init gmidi_init(void)
 {
-	return usb_gadget_register_driver(&gmidi_driver);
+	return usb_gadget_probe_driver(&gmidi_driver, gmidi_bind);
 }
 module_init(gmidi_init);
 
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index 1088d08..49fbd4d 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -1343,14 +1343,15 @@ static struct goku_udc	*the_controller;
  * disconnect is reported.  then a host may connect again, or
  * the driver might get unbound.
  */
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct goku_udc	*dev = the_controller;
 	int			retval;
 
 	if (!driver
 			|| driver->speed < USB_SPEED_FULL
-			|| !driver->bind
+			|| !bind
 			|| !driver->disconnect
 			|| !driver->setup)
 		return -EINVAL;
@@ -1363,7 +1364,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	driver->driver.bus = NULL;
 	dev->driver = driver;
 	dev->gadget.dev.driver = &driver->driver;
-	retval = driver->bind(&dev->gadget);
+	retval = bind(&dev->gadget);
 	if (retval) {
 		DBG(dev, "bind to driver %s --> error %d\n",
 				driver->driver.name, retval);
@@ -1380,7 +1381,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	DBG(dev, "registered gadget driver '%s'\n", driver->driver.name);
 	return 0;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 static void
 stop_activity(struct goku_udc *dev, struct usb_gadget_driver *driver)
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c
index e743122..ed02664 100644
--- a/drivers/usb/gadget/imx_udc.c
+++ b/drivers/usb/gadget/imx_udc.c
@@ -1319,14 +1319,15 @@ static struct imx_udc_struct controller = {
  * USB gadged driver functions
  *******************************************************************************
  */
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct imx_udc_struct *imx_usb = &controller;
 	int retval;
 
 	if (!driver
 		|| driver->speed < USB_SPEED_FULL
-		|| !driver->bind
+		|| !bind
 		|| !driver->disconnect
 		|| !driver->setup)
 			return -EINVAL;
@@ -1342,7 +1343,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	retval = device_add(&imx_usb->gadget.dev);
 	if (retval)
 		goto fail;
-	retval = driver->bind(&imx_usb->gadget);
+	retval = bind(&imx_usb->gadget);
 	if (retval) {
 		D_ERR(imx_usb->dev, "<%s> bind to driver %s --> error %d\n",
 			__func__, driver->driver.name, retval);
@@ -1362,7 +1363,7 @@ fail:
 	imx_usb->gadget.dev.driver = NULL;
 	return retval;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 {
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index de8a838..1da5583 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1777,7 +1777,6 @@ static struct usb_gadget_driver gadgetfs_driver = {
 	.speed		= USB_SPEED_FULL,
 #endif
 	.function	= (char *) driver_desc,
-	.bind		= gadgetfs_bind,
 	.unbind		= gadgetfs_unbind,
 	.setup		= gadgetfs_setup,
 	.disconnect	= gadgetfs_disconnect,
@@ -1800,7 +1799,6 @@ static int gadgetfs_probe (struct usb_gadget *gadget)
 
 static struct usb_gadget_driver probe_driver = {
 	.speed		= USB_SPEED_HIGH,
-	.bind		= gadgetfs_probe,
 	.unbind		= gadgetfs_nop,
 	.setup		= (void *)gadgetfs_nop,
 	.disconnect	= gadgetfs_nop,
@@ -1914,7 +1912,7 @@ dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
 
 	/* triggers gadgetfs_bind(); then we can enumerate. */
 	spin_unlock_irq (&dev->lock);
-	value = usb_gadget_register_driver (&gadgetfs_driver);
+	value = usb_gadget_probe_driver(&gadgetfs_driver, gadgetfs_bind);
 	if (value != 0) {
 		kfree (dev->buf);
 		dev->buf = NULL;
@@ -2053,7 +2051,7 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
 		return -ESRCH;
 
 	/* fake probe to determine $CHIP */
-	(void) usb_gadget_register_driver (&probe_driver);
+	(void) usb_gadget_probe_driver(&probe_driver, gadgetfs_probe);
 	if (!CHIP)
 		return -ENODEV;
 
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
index a391351..e7222de 100644
--- a/drivers/usb/gadget/langwell_udc.c
+++ b/drivers/usb/gadget/langwell_udc.c
@@ -1807,7 +1807,8 @@ static DEVICE_ATTR(langwell_udc, S_IRUGO, show_langwell_udc, NULL);
  * the driver might get unbound.
  */
 
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct langwell_udc	*dev = the_controller;
 	unsigned long		flags;
@@ -1830,7 +1831,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 
 	spin_unlock_irqrestore(&dev->lock, flags);
 
-	retval = driver->bind(&dev->gadget);
+	retval = bind(&dev->gadget);
 	if (retval) {
 		DBG(dev, "bind to driver %s --> %d\n",
 				driver->driver.name, retval);
@@ -1868,7 +1869,7 @@ err_unbind:
 	DBG(dev, "<--- %s()\n", __func__);
 	return retval;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 
 /* unregister gadget driver */
@@ -1882,7 +1883,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 
 	DBG(dev, "---> %s()\n", __func__);
 
-	if (unlikely(!driver || !driver->bind || !driver->unbind))
+	if (unlikely(!driver || !driver->unbind))
 		return -EINVAL;
 
 	/* unbind OTG transceiver */
diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c
index fded3fc..6b58bd8 100644
--- a/drivers/usb/gadget/lh7a40x_udc.c
+++ b/drivers/usb/gadget/lh7a40x_udc.c
@@ -408,7 +408,8 @@ static void udc_enable(struct lh7a40x_udc *dev)
 /*
   Register entry point for the peripheral controller driver.
 */
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct lh7a40x_udc *dev = the_controller;
 	int retval;
@@ -417,7 +418,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 
 	if (!driver
 			|| driver->speed != USB_SPEED_FULL
-			|| !driver->bind
+			|| !bind
 			|| !driver->disconnect
 			|| !driver->setup)
 		return -EINVAL;
@@ -431,7 +432,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	dev->gadget.dev.driver = &driver->driver;
 
 	device_add(&dev->gadget.dev);
-	retval = driver->bind(&dev->gadget);
+	retval = bind(&dev->gadget);
 	if (retval) {
 		printk(KERN_WARNING "%s: bind to driver %s --> error %d\n",
 		       dev->gadget.name, driver->driver.name, retval);
@@ -453,8 +454,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 
 	return 0;
 }
-
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 /*
   Unregister entry point for the peripheral controller driver.
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c
index 166bf71..2ce1f49 100644
--- a/drivers/usb/gadget/m66592-udc.c
+++ b/drivers/usb/gadget/m66592-udc.c
@@ -1454,14 +1454,15 @@ static struct usb_ep_ops m66592_ep_ops = {
 /*-------------------------------------------------------------------------*/
 static struct m66592 *the_controller;
 
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct m66592 *m66592 = the_controller;
 	int retval;
 
 	if (!driver
 			|| driver->speed != USB_SPEED_HIGH
-			|| !driver->bind
+			|| !bind
 			|| !driver->setup)
 		return -EINVAL;
 	if (!m66592)
@@ -1480,7 +1481,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 		goto error;
 	}
 
-	retval = driver->bind (&m66592->gadget);
+	retval = bind(&m66592->gadget);
 	if (retval) {
 		pr_err("bind to driver error (%d)\n", retval);
 		device_del(&m66592->gadget.dev);
@@ -1505,7 +1506,7 @@ error:
 
 	return retval;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 {
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 9498be8..d09155b 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -1929,7 +1929,8 @@ static void ep0_start (struct net2280 *dev)
  * disconnect is reported.  then a host may connect again, or
  * the driver might get unbound.
  */
-int usb_gadget_register_driver (struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct net2280		*dev = the_controller;
 	int			retval;
@@ -1941,8 +1942,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
 	 */
 	if (!driver
 			|| driver->speed != USB_SPEED_HIGH
-			|| !driver->bind
-			|| !driver->setup)
+			|| !bind || !driver->setup)
 		return -EINVAL;
 	if (!dev)
 		return -ENODEV;
@@ -1957,7 +1957,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
 	driver->driver.bus = NULL;
 	dev->driver = driver;
 	dev->gadget.dev.driver = &driver->driver;
-	retval = driver->bind (&dev->gadget);
+	retval = bind(&dev->gadget);
 	if (retval) {
 		DEBUG (dev, "bind to driver %s --> %d\n",
 				driver->driver.name, retval);
@@ -1993,7 +1993,7 @@ err_unbind:
 	dev->driver = NULL;
 	return retval;
 }
-EXPORT_SYMBOL (usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 static void
 stop_activity (struct net2280 *dev, struct usb_gadget_driver *driver)
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index f81e4f0..61d3ca6 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -2102,7 +2102,8 @@ static inline int machine_without_vbus_sense(void)
 		);
 }
 
-int usb_gadget_register_driver (struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	int		status = -ENODEV;
 	struct omap_ep	*ep;
@@ -2114,8 +2115,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
 	if (!driver
 			// FIXME if otg, check:  driver->is_otg
 			|| driver->speed < USB_SPEED_FULL
-			|| !driver->bind
-			|| !driver->setup)
+			|| !bind || !driver->setup)
 		return -EINVAL;
 
 	spin_lock_irqsave(&udc->lock, flags);
@@ -2145,7 +2145,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
 	if (udc->dc_clk != NULL)
 		omap_udc_enable_clock(1);
 
-	status = driver->bind (&udc->gadget);
+	status = bind(&udc->gadget);
 	if (status) {
 		DBG("bind to %s --> %d\n", driver->driver.name, status);
 		udc->gadget.dev.driver = NULL;
@@ -2186,7 +2186,7 @@ done:
 		omap_udc_enable_clock(0);
 	return status;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
 {
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
index 4c3ac5c..317f113 100644
--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -1542,7 +1542,6 @@ static struct usb_gadget_driver printer_driver = {
 	.speed		= DEVSPEED,
 
 	.function	= (char *) driver_desc,
-	.bind		= printer_bind,
 	.unbind		= printer_unbind,
 
 	.setup		= printer_setup,
@@ -1578,11 +1577,11 @@ init(void)
 		return status;
 	}
 
-	status = usb_gadget_register_driver(&printer_driver);
+	status = usb_gadget_probe_driver(&printer_driver, printer_bind);
 	if (status) {
 		class_destroy(usb_gadget_class);
 		unregister_chrdev_region(g_printer_devno, 1);
-		DBG(dev, "usb_gadget_register_driver %x\n", status);
+		DBG(dev, "usb_gadget_probe_driver %x\n", status);
 	}
 
 	return status;
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index be5fb34..b37f92c 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -1280,14 +1280,15 @@ static void udc_enable (struct pxa25x_udc *dev)
  * disconnect is reported.  then a host may connect again, or
  * the driver might get unbound.
  */
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct pxa25x_udc	*dev = the_controller;
 	int			retval;
 
 	if (!driver
 			|| driver->speed < USB_SPEED_FULL
-			|| !driver->bind
+			|| !bind
 			|| !driver->disconnect
 			|| !driver->setup)
 		return -EINVAL;
@@ -1308,7 +1309,7 @@ fail:
 		dev->gadget.dev.driver = NULL;
 		return retval;
 	}
-	retval = driver->bind(&dev->gadget);
+	retval = bind(&dev->gadget);
 	if (retval) {
 		DMSG("bind to driver %s --> error %d\n",
 				driver->driver.name, retval);
@@ -1338,7 +1339,7 @@ fail:
 bind_fail:
 	return retval;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 static void
 stop_activity(struct pxa25x_udc *dev, struct usb_gadget_driver *driver)
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index 9807624..027d66f 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -1792,8 +1792,9 @@ static void udc_enable(struct pxa_udc *udc)
 }
 
 /**
- * usb_gadget_register_driver - Register gadget driver
+ * usb_gadget_probe_driver - Register gadget driver
  * @driver: gadget driver
+ * @bind: bind function
  *
  * When a driver is successfully registered, it will receive control requests
  * including set_configuration(), which enables non-control requests.  Then
@@ -1805,12 +1806,13 @@ static void udc_enable(struct pxa_udc *udc)
  *
  * Returns 0 if no error, -EINVAL, -ENODEV, -EBUSY otherwise
  */
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct pxa_udc *udc = the_controller;
 	int retval;
 
-	if (!driver || driver->speed < USB_SPEED_FULL || !driver->bind
+	if (!driver || driver->speed < USB_SPEED_FULL || !bind
 			|| !driver->disconnect || !driver->setup)
 		return -EINVAL;
 	if (!udc)
@@ -1828,7 +1830,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 		dev_err(udc->dev, "device_add error %d\n", retval);
 		goto add_fail;
 	}
-	retval = driver->bind(&udc->gadget);
+	retval = bind(&udc->gadget);
 	if (retval) {
 		dev_err(udc->dev, "bind to driver %s --> error %d\n",
 			driver->driver.name, retval);
@@ -1859,7 +1861,7 @@ add_fail:
 	udc->gadget.dev.driver = NULL;
 	return retval;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 
 /**
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c
index 70a8178..5545d41 100644
--- a/drivers/usb/gadget/r8a66597-udc.c
+++ b/drivers/usb/gadget/r8a66597-udc.c
@@ -1405,14 +1405,15 @@ static struct usb_ep_ops r8a66597_ep_ops = {
 /*-------------------------------------------------------------------------*/
 static struct r8a66597 *the_controller;
 
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct r8a66597 *r8a66597 = the_controller;
 	int retval;
 
 	if (!driver
 			|| driver->speed != USB_SPEED_HIGH
-			|| !driver->bind
+			|| !bind
 			|| !driver->setup)
 		return -EINVAL;
 	if (!r8a66597)
@@ -1431,7 +1432,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 		goto error;
 	}
 
-	retval = driver->bind(&r8a66597->gadget);
+	retval = bind(&r8a66597->gadget);
 	if (retval) {
 		printk(KERN_ERR "bind to driver error (%d)\n", retval);
 		device_del(&r8a66597->gadget.dev);
@@ -1456,7 +1457,7 @@ error:
 
 	return retval;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 {
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index 26193ec..89f04bc 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -2478,7 +2478,8 @@ static int s3c_hsotg_corereset(struct s3c_hsotg *hsotg)
 	return 0;
 }
 
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct s3c_hsotg *hsotg = our_hsotg;
 	int ret;
@@ -2498,7 +2499,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 		dev_err(hsotg->dev, "%s: bad speed\n", __func__);
 	}
 
-	if (!driver->bind || !driver->setup) {
+	if (!bind || !driver->setup) {
 		dev_err(hsotg->dev, "%s: missing entry points\n", __func__);
 		return -EINVAL;
 	}
@@ -2517,7 +2518,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 		goto err;
 	}
 
-	ret = driver->bind(&hsotg->gadget);
+	ret = bind(&hsotg->gadget);
 	if (ret) {
 		dev_err(hsotg->dev, "failed bind %s\n", driver->driver.name);
 
@@ -2641,7 +2642,7 @@ err:
 	hsotg->gadget.dev.driver = NULL;
 	return ret;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 {
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index ea2b3c7..c244895 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -1632,15 +1632,15 @@ static void s3c2410_udc_enable(struct s3c2410_udc *dev)
 }
 
 /*
- *	usb_gadget_register_driver
+ *	usb_gadget_probe_driver
  */
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	struct s3c2410_udc *udc = the_controller;
 	int		retval;
 
-	dprintk(DEBUG_NORMAL, "usb_gadget_register_driver() '%s'\n",
-		driver->driver.name);
+	dprintk(DEBUG_NORMAL, "%s() '%s'\n", __func__, driver->driver.name);
 
 	/* Sanity checks */
 	if (!udc)
@@ -1649,10 +1649,9 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	if (udc->driver)
 		return -EBUSY;
 
-	if (!driver->bind || !driver->setup
-			|| driver->speed < USB_SPEED_FULL) {
+	if (!bind || !driver->setup || driver->speed < USB_SPEED_FULL) {
 		printk(KERN_ERR "Invalid driver: bind %p setup %p speed %d\n",
-			driver->bind, driver->setup, driver->speed);
+			bind, driver->setup, driver->speed);
 		return -EINVAL;
 	}
 #if defined(MODULE)
@@ -1675,7 +1674,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	dprintk(DEBUG_NORMAL, "binding gadget driver '%s'\n",
 		driver->driver.name);
 
-	if ((retval = driver->bind (&udc->gadget)) != 0) {
+	if ((retval = bind(&udc->gadget)) != 0) {
 		device_del(&udc->gadget.dev);
 		goto register_error;
 	}
@@ -1690,6 +1689,7 @@ register_error:
 	udc->gadget.dev.driver = NULL;
 	return retval;
 }
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 /*
  *	usb_gadget_unregister_driver
@@ -2049,7 +2049,6 @@ static void __exit udc_exit(void)
 }
 
 EXPORT_SYMBOL(usb_gadget_unregister_driver);
-EXPORT_SYMBOL(usb_gadget_register_driver);
 
 module_init(udc_init);
 module_exit(udc_exit);
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 6fca870..d940e80 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1696,9 +1696,11 @@ void musb_gadget_cleanup(struct musb *musb)
  * -ENOMEM no memeory to perform the operation
  *
  * @param driver the gadget driver
+ * @param bind the driver's bind function
  * @return <0 if error, 0 if everything is fine
  */
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *))
 {
 	int retval;
 	unsigned long flags;
@@ -1706,8 +1708,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 
 	if (!driver
 			|| driver->speed != USB_SPEED_HIGH
-			|| !driver->bind
-			|| !driver->setup)
+			|| !bind || !driver->setup)
 		return -EINVAL;
 
 	/* driver must be initialized to support peripheral mode */
@@ -1735,7 +1736,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	spin_unlock_irqrestore(&musb->lock, flags);
 
 	if (retval == 0) {
-		retval = driver->bind(&musb->g);
+		retval = bind(&musb->g);
 		if (retval != 0) {
 			DBG(3, "bind to driver %s failed --> %d\n",
 					driver->driver.name, retval);
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index d3ef42d..006412c 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -705,11 +705,6 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
  * struct usb_gadget_driver - driver for usb 'slave' devices
  * @function: String describing the gadget's function
  * @speed: Highest speed the driver handles.
- * @bind: Invoked when the driver is bound to a gadget, usually
- *	after registering the driver.
- *	At that point, ep0 is fully initialized, and ep_list holds
- *	the currently-available endpoints.
- *	Called in a context that permits sleeping.
  * @setup: Invoked for ep0 control requests that aren't handled by
  *	the hardware level driver. Most calls must be handled by
  *	the gadget driver, including descriptor and configuration
@@ -774,7 +769,6 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
 struct usb_gadget_driver {
 	char			*function;
 	enum usb_device_speed	speed;
-	int			(*bind)(struct usb_gadget *);
 	void			(*unbind)(struct usb_gadget *);
 	int			(*setup)(struct usb_gadget *,
 					const struct usb_ctrlrequest *);
@@ -798,17 +792,19 @@ struct usb_gadget_driver {
  */
 
 /**
- * usb_gadget_register_driver - register a gadget driver
- * @driver:the driver being registered
+ * usb_gadget_probe_driver - probe a gadget driver
+ * @driver: the driver being registered
+ * @bind: the driver's bind callback
  * Context: can sleep
  *
  * Call this in your gadget driver's module initialization function,
  * to tell the underlying usb controller driver about your driver.
- * The driver's bind() function will be called to bind it to a
- * gadget before this registration call returns.  It's expected that
- * the bind() functions will be in init sections.
+ * The @bind() function will be called to bind it to a gadget before this
+ * registration call returns.  It's expected that the @bind() function will
+ * be in init sections.
  */
-int usb_gadget_register_driver(struct usb_gadget_driver *driver);
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *));
 
 /**
  * usb_gadget_unregister_driver - unregister a gadget driver
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 14/19] usb gadget: don't save bind callback in struct usb_configuration
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (13 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  2010-08-05 14:21     ` Uwe Kleine-König
  -1 siblings, 1 reply; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

The bind function is only called at init time so there is no need to
save a pointer to it in the driver struct.

This fixes many section mismatches reported by modpost.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Micha? Nazarewicz <m.nazarewicz@samsung.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/gadget/audio.c        |    3 +--
 drivers/usb/gadget/cdc2.c         |    3 +--
 drivers/usb/gadget/composite.c    |   14 ++++++++------
 drivers/usb/gadget/ether.c        |    7 +++----
 drivers/usb/gadget/f_loopback.c   |    3 +--
 drivers/usb/gadget/f_sourcesink.c |    3 +--
 drivers/usb/gadget/g_ffs.c        |    9 +++------
 drivers/usb/gadget/hid.c          |    3 +--
 drivers/usb/gadget/mass_storage.c |    3 +--
 drivers/usb/gadget/multi.c        |    6 ++----
 drivers/usb/gadget/nokia.c        |    8 ++++----
 drivers/usb/gadget/serial.c       |    4 ++--
 drivers/usb/gadget/webcam.c       |    4 ++--
 include/linux/usb/composite.h     |    5 +----
 14 files changed, 31 insertions(+), 44 deletions(-)

diff --git a/drivers/usb/gadget/audio.c b/drivers/usb/gadget/audio.c
index a62af7b..eeff9b2 100644
--- a/drivers/usb/gadget/audio.c
+++ b/drivers/usb/gadget/audio.c
@@ -105,7 +105,6 @@ static int __init audio_do_config(struct usb_configuration *c)
 
 static struct usb_configuration audio_config_driver = {
 	.label			= DRIVER_DESC,
-	.bind			= audio_do_config,
 	.bConfigurationValue	= 1,
 	/* .iConfiguration = DYNAMIC */
 	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
@@ -145,7 +144,7 @@ static int __init audio_bind(struct usb_composite_dev *cdev)
 	strings_dev[STRING_PRODUCT_IDX].id = status;
 	device_desc.iProduct = status;
 
-	status = usb_add_config(cdev, &audio_config_driver);
+	status = usb_add_config(cdev, &audio_config_driver, audio_do_config);
 	if (status < 0)
 		goto fail;
 
diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c
index 928137d..c3d2c86 100644
--- a/drivers/usb/gadget/cdc2.c
+++ b/drivers/usb/gadget/cdc2.c
@@ -151,7 +151,6 @@ static int __init cdc_do_config(struct usb_configuration *c)
 
 static struct usb_configuration cdc_config_driver = {
 	.label			= "CDC Composite (ECM + ACM)",
-	.bind			= cdc_do_config,
 	.bConfigurationValue	= 1,
 	/* .iConfiguration = DYNAMIC */
 	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
@@ -218,7 +217,7 @@ static int __init cdc_bind(struct usb_composite_dev *cdev)
 	device_desc.iProduct = status;
 
 	/* register our configuration */
-	status = usb_add_config(cdev, &cdc_config_driver);
+	status = usb_add_config(cdev, &cdc_config_driver, cdc_do_config);
 	if (status < 0)
 		goto fail1;
 
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index d07960e..b6cc043 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -470,18 +470,20 @@ done:
  * usb_add_config() - add a configuration to a device.
  * @cdev: wraps the USB gadget
  * @config: the configuration, with bConfigurationValue assigned
+ * @bind: the configuration's bind function
  * Context: single threaded during gadget setup
  *
- * One of the main tasks of a composite driver's bind() routine is to
+ * One of the main tasks of a composite @bind() routine is to
  * add each of the configurations it supports, using this routine.
  *
- * This function returns the value of the configuration's bind(), which
+ * This function returns the value of the configuration's @bind(), which
  * is zero for success else a negative errno value.  Binding configurations
  * assigns global resources including string IDs, and per-configuration
  * resources such as interface IDs and endpoints.
  */
 int usb_add_config(struct usb_composite_dev *cdev,
-		struct usb_configuration *config)
+		struct usb_configuration *config,
+		int (*bind)(struct usb_configuration *))
 {
 	int				status = -EINVAL;
 	struct usb_configuration	*c;
@@ -490,7 +492,7 @@ int usb_add_config(struct usb_composite_dev *cdev,
 			config->bConfigurationValue,
 			config->label, config);
 
-	if (!config->bConfigurationValue || !config->bind)
+	if (!config->bConfigurationValue || !bind)
 		goto done;
 
 	/* Prevent duplicate configuration identifiers */
@@ -507,7 +509,7 @@ int usb_add_config(struct usb_composite_dev *cdev,
 	INIT_LIST_HEAD(&config->functions);
 	config->next_interface_id = 0;
 
-	status = config->bind(config);
+	status = bind(config);
 	if (status < 0) {
 		list_del(&config->list);
 		config->cdev = NULL;
@@ -533,7 +535,7 @@ int usb_add_config(struct usb_composite_dev *cdev,
 		}
 	}
 
-	/* set_alt(), or next config->bind(), sets up
+	/* set_alt(), or next bind(), sets up
 	 * ep->driver_data as needed.
 	 */
 	usb_ep_autoconfig_reset(cdev->gadget);
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 400f803..cd03bea 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -251,7 +251,6 @@ static int __init rndis_do_config(struct usb_configuration *c)
 
 static struct usb_configuration rndis_config_driver = {
 	.label			= "RNDIS",
-	.bind			= rndis_do_config,
 	.bConfigurationValue	= 2,
 	/* .iConfiguration = DYNAMIC */
 	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
@@ -289,7 +288,6 @@ static int __init eth_do_config(struct usb_configuration *c)
 
 static struct usb_configuration eth_config_driver = {
 	/* .label = f(hardware) */
-	.bind			= eth_do_config,
 	.bConfigurationValue	= 1,
 	/* .iConfiguration = DYNAMIC */
 	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
@@ -373,12 +371,13 @@ static int __init eth_bind(struct usb_composite_dev *cdev)
 
 	/* register our configuration(s); RNDIS first, if it's used */
 	if (has_rndis()) {
-		status = usb_add_config(cdev, &rndis_config_driver);
+		status = usb_add_config(cdev, &rndis_config_driver,
+				rndis_do_config);
 		if (status < 0)
 			goto fail;
 	}
 
-	status = usb_add_config(cdev, &eth_config_driver);
+	status = usb_add_config(cdev, &eth_config_driver, eth_do_config);
 	if (status < 0)
 		goto fail;
 
diff --git a/drivers/usb/gadget/f_loopback.c b/drivers/usb/gadget/f_loopback.c
index e91d1b1..b37960f 100644
--- a/drivers/usb/gadget/f_loopback.c
+++ b/drivers/usb/gadget/f_loopback.c
@@ -349,7 +349,6 @@ static int __init loopback_bind_config(struct usb_configuration *c)
 static struct usb_configuration loopback_driver = {
 	.label		= "loopback",
 	.strings	= loopback_strings,
-	.bind		= loopback_bind_config,
 	.bConfigurationValue = 2,
 	.bmAttributes	= USB_CONFIG_ATT_SELFPOWER,
 	/* .iConfiguration = DYNAMIC */
@@ -382,5 +381,5 @@ int __init loopback_add(struct usb_composite_dev *cdev, bool autoresume)
 		loopback_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
 	}
 
-	return usb_add_config(cdev, &loopback_driver);
+	return usb_add_config(cdev, &loopback_driver, loopback_bind_config);
 }
diff --git a/drivers/usb/gadget/f_sourcesink.c b/drivers/usb/gadget/f_sourcesink.c
index 6d3cc44..e403a53 100644
--- a/drivers/usb/gadget/f_sourcesink.c
+++ b/drivers/usb/gadget/f_sourcesink.c
@@ -498,7 +498,6 @@ unknown:
 static struct usb_configuration sourcesink_driver = {
 	.label		= "source/sink",
 	.strings	= sourcesink_strings,
-	.bind		= sourcesink_bind_config,
 	.setup		= sourcesink_setup,
 	.bConfigurationValue = 3,
 	.bmAttributes	= USB_CONFIG_ATT_SELFPOWER,
@@ -532,5 +531,5 @@ int __init sourcesink_add(struct usb_composite_dev *cdev, bool autoresume)
 		sourcesink_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
 	}
 
-	return usb_add_config(cdev, &sourcesink_driver);
+	return usb_add_config(cdev, &sourcesink_driver, sourcesink_bind_config);
 }
diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c
index d1af253..ddae926 100644
--- a/drivers/usb/gadget/g_ffs.c
+++ b/drivers/usb/gadget/g_ffs.c
@@ -151,13 +151,12 @@ static int gfs_do_rndis_config(struct usb_configuration *c);
 
 static struct usb_configuration gfs_rndis_config_driver = {
 	.label			= "FunctionFS + RNDIS",
-	.bind			= gfs_do_rndis_config,
 	.bConfigurationValue	= 1,
 	/* .iConfiguration	= DYNAMIC */
 	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
 };
 #  define gfs_add_rndis_config(cdev) \
-	usb_add_config(cdev, &gfs_rndis_config_driver)
+	usb_add_config(cdev, &gfs_rndis_config_driver, gfs_do_rndis_config)
 #else
 #  define gfs_add_rndis_config(cdev) 0
 #endif
@@ -168,13 +167,12 @@ static int gfs_do_ecm_config(struct usb_configuration *c);
 
 static struct usb_configuration gfs_ecm_config_driver = {
 	.label			= "FunctionFS + ECM",
-	.bind			= gfs_do_ecm_config,
 	.bConfigurationValue	= 1,
 	/* .iConfiguration	= DYNAMIC */
 	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
 };
 #  define gfs_add_ecm_config(cdev) \
-	usb_add_config(cdev, &gfs_ecm_config_driver)
+	usb_add_config(cdev, &gfs_ecm_config_driver, gfs_do_ecm_config)
 #else
 #  define gfs_add_ecm_config(cdev) 0
 #endif
@@ -185,13 +183,12 @@ static int gfs_do_generic_config(struct usb_configuration *c);
 
 static struct usb_configuration gfs_generic_config_driver = {
 	.label			= "FunctionFS",
-	.bind			= gfs_do_generic_config,
 	.bConfigurationValue	= 2,
 	/* .iConfiguration	= DYNAMIC */
 	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
 };
 #  define gfs_add_generic_config(cdev) \
-	usb_add_config(cdev, &gfs_generic_config_driver)
+	usb_add_config(cdev, &gfs_generic_config_driver, gfs_do_generic_config)
 #else
 #  define gfs_add_generic_config(cdev) 0
 #endif
diff --git a/drivers/usb/gadget/hid.c b/drivers/usb/gadget/hid.c
index 7757226..2ce69c6 100644
--- a/drivers/usb/gadget/hid.c
+++ b/drivers/usb/gadget/hid.c
@@ -148,7 +148,6 @@ static int __init do_config(struct usb_configuration *c)
 
 static struct usb_configuration config_driver = {
 	.label			= "HID Gadget",
-	.bind			= do_config,
 	.bConfigurationValue	= 1,
 	/* .iConfiguration = DYNAMIC */
 	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
@@ -201,7 +200,7 @@ static int __init hid_bind(struct usb_composite_dev *cdev)
 	device_desc.iProduct = status;
 
 	/* register our configuration */
-	status = usb_add_config(cdev, &config_driver);
+	status = usb_add_config(cdev, &config_driver, do_config);
 	if (status < 0)
 		return status;
 
diff --git a/drivers/usb/gadget/mass_storage.c b/drivers/usb/gadget/mass_storage.c
index 705cc1f..21a65a2 100644
--- a/drivers/usb/gadget/mass_storage.c
+++ b/drivers/usb/gadget/mass_storage.c
@@ -165,7 +165,6 @@ static int __init msg_do_config(struct usb_configuration *c)
 
 static struct usb_configuration msg_config_driver = {
 	.label			= "Linux File-Backed Storage",
-	.bind			= msg_do_config,
 	.bConfigurationValue	= 1,
 	/* .iConfiguration = DYNAMIC */
 	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
@@ -208,7 +207,7 @@ static int __init msg_bind(struct usb_composite_dev *cdev)
 	msg_config_driver.iConfiguration = status;
 
 	/* register our second configuration */
-	status = usb_add_config(cdev, &msg_config_driver);
+	status = usb_add_config(cdev, &msg_config_driver, msg_do_config);
 	if (status < 0)
 		return status;
 
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c
index a930d7f..84c9ab6 100644
--- a/drivers/usb/gadget/multi.c
+++ b/drivers/usb/gadget/multi.c
@@ -181,7 +181,6 @@ static int __init rndis_do_config(struct usb_configuration *c)
 
 static struct usb_configuration rndis_config_driver = {
 	.label			= "Multifunction Composite (RNDIS + MS + ACM)",
-	.bind			= rndis_do_config,
 	.bConfigurationValue	= 2,
 	/* .iConfiguration = DYNAMIC */
 	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
@@ -217,7 +216,6 @@ static int __init cdc_do_config(struct usb_configuration *c)
 
 static struct usb_configuration cdc_config_driver = {
 	.label			= "Multifunction Composite (CDC + MS + ACM)",
-	.bind			= cdc_do_config,
 	.bConfigurationValue	= 1,
 	/* .iConfiguration = DYNAMIC */
 	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
@@ -295,14 +293,14 @@ static int __init multi_bind(struct usb_composite_dev *cdev)
 
 #ifdef USB_ETH_RNDIS
 	/* register our first configuration */
-	status = usb_add_config(cdev, &rndis_config_driver);
+	status = usb_add_config(cdev, &rndis_config_driver, rndis_do_config);
 	if (status < 0)
 		goto fail2;
 #endif
 
 #ifdef CONFIG_USB_G_MULTI_CDC
 	/* register our second configuration */
-	status = usb_add_config(cdev, &cdc_config_driver);
+	status = usb_add_config(cdev, &cdc_config_driver, cdc_do_config);
 	if (status < 0)
 		goto fail2;
 #endif
diff --git a/drivers/usb/gadget/nokia.c b/drivers/usb/gadget/nokia.c
index 7d6b66a..a7dda39 100644
--- a/drivers/usb/gadget/nokia.c
+++ b/drivers/usb/gadget/nokia.c
@@ -135,7 +135,6 @@ static int __init nokia_bind_config(struct usb_configuration *c)
 
 static struct usb_configuration nokia_config_500ma_driver = {
 	.label		= "Bus Powered",
-	.bind		= nokia_bind_config,
 	.bConfigurationValue = 1,
 	/* .iConfiguration = DYNAMIC */
 	.bmAttributes	= USB_CONFIG_ATT_ONE,
@@ -144,7 +143,6 @@ static struct usb_configuration nokia_config_500ma_driver = {
 
 static struct usb_configuration nokia_config_100ma_driver = {
 	.label		= "Self Powered",
-	.bind		= nokia_bind_config,
 	.bConfigurationValue = 2,
 	/* .iConfiguration = DYNAMIC */
 	.bmAttributes	= USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
@@ -206,11 +204,13 @@ static int __init nokia_bind(struct usb_composite_dev *cdev)
 	}
 
 	/* finaly register the configuration */
-	status = usb_add_config(cdev, &nokia_config_500ma_driver);
+	status = usb_add_config(cdev, &nokia_config_500ma_driver,
+			nokia_bind_config);
 	if (status < 0)
 		goto err_usb;
 
-	status = usb_add_config(cdev, &nokia_config_100ma_driver);
+	status = usb_add_config(cdev, &nokia_config_100ma_driver,
+			nokia_bind_config);
 	if (status < 0)
 		goto err_usb;
 
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index f46a609..8838f03 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -155,7 +155,6 @@ static int __init serial_bind_config(struct usb_configuration *c)
 
 static struct usb_configuration serial_config_driver = {
 	/* .label = f(use_acm) */
-	.bind		= serial_bind_config,
 	/* .bConfigurationValue = f(use_acm) */
 	/* .iConfiguration = DYNAMIC */
 	.bmAttributes	= USB_CONFIG_ATT_SELFPOWER,
@@ -225,7 +224,8 @@ static int __init gs_bind(struct usb_composite_dev *cdev)
 	}
 
 	/* register our configuration */
-	status = usb_add_config(cdev, &serial_config_driver);
+	status = usb_add_config(cdev, &serial_config_driver,
+			serial_bind_config);
 	if (status < 0)
 		goto fail;
 
diff --git a/drivers/usb/gadget/webcam.c b/drivers/usb/gadget/webcam.c
index 288d211..bfea319 100644
--- a/drivers/usb/gadget/webcam.c
+++ b/drivers/usb/gadget/webcam.c
@@ -317,7 +317,6 @@ webcam_config_bind(struct usb_configuration *c)
 
 static struct usb_configuration webcam_config_driver = {
 	.label			= webcam_config_label,
-	.bind			= webcam_config_bind,
 	.bConfigurationValue	= 1,
 	.iConfiguration		= 0, /* dynamic */
 	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
@@ -354,7 +353,8 @@ webcam_bind(struct usb_composite_dev *cdev)
 	webcam_config_driver.iConfiguration = ret;
 
 	/* Register our configuration. */
-	if ((ret = usb_add_config(cdev, &webcam_config_driver)) < 0)
+	if ((ret = usb_add_config(cdev, &webcam_config_driver,
+					webcam_config_bind)) < 0)
 		goto error;
 
 	INFO(cdev, "Webcam Video Gadget\n");
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 139353e..fc750b1 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -161,8 +161,6 @@ ep_choose(struct usb_gadget *g, struct usb_endpoint_descriptor *hs,
  *	and by language IDs provided in control requests.
  * @descriptors: Table of descriptors preceding all function descriptors.
  *	Examples include OTG and vendor-specific descriptors.
- * @bind: Called from @usb_add_config() to allocate resources unique to this
- *	configuration and to call @usb_add_function() for each function used.
  * @unbind: Reverses @bind; called as a side effect of unregistering the
  *	driver which added this configuration.
  * @setup: Used to delegate control requests that aren't handled by standard
@@ -207,8 +205,7 @@ struct usb_configuration {
 	 * we can't restructure things to avoid mismatching...
 	 */
 
-	/* configuration management:  bind/unbind */
-	int			(*bind)(struct usb_configuration *);
+	/* configuration management: unbind/setup */
 	void			(*unbind)(struct usb_configuration *);
 	int			(*setup)(struct usb_configuration *,
 					const struct usb_ctrlrequest *);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 15/19] SPI: amba-pl022: move probe and remove to .devinit and .devexit resp.
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (14 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  2010-08-05 17:14     ` Kevin Wells
  -1 siblings, 1 reply; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

The driver can be bound via sysfs after the .init sections are already
discarded, so pl022_probe must not be in .init.text.  If there is no remove
function the driver can still be unbound without any callback being run.
So pl022_remove must not be in .exit.text.

This fixes a section mismatch reported by modpost.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/amba-pl022.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c
index f0a1418..acd35d1 100644
--- a/drivers/spi/amba-pl022.c
+++ b/drivers/spi/amba-pl022.c
@@ -1723,7 +1723,7 @@ static void pl022_cleanup(struct spi_device *spi)
 }
 
 
-static int __init
+static int __devinit
 pl022_probe(struct amba_device *adev, struct amba_id *id)
 {
 	struct device *dev = &adev->dev;
@@ -1838,7 +1838,7 @@ pl022_probe(struct amba_device *adev, struct amba_id *id)
 	return status;
 }
 
-static int __exit
+static int __devexit
 pl022_remove(struct amba_device *adev)
 {
 	struct pl022 *pl022 = amba_get_drvdata(adev);
@@ -1970,7 +1970,7 @@ static struct amba_driver pl022_driver = {
 	},
 	.id_table	= pl022_ids,
 	.probe		= pl022_probe,
-	.remove		= __exit_p(pl022_remove),
+	.remove		= __devexit_p(pl022_remove),
 	.suspend        = pl022_suspend,
 	.resume         = pl022_resume,
 };
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (15 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  2010-08-09  6:59     ` Rabin VINCENT
  2010-09-02 10:30     ` [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe Linus Walleij
  -1 siblings, 2 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

This fixes a section mismatch reported by modpost:

	WARNING: arch/arm/plat-nomadik/built-in.o(.data+0x100): Section mismatch in reference from the variable nmk_gpio_driver to the function .init.text:nmk_gpio_probe()
	The variable nmk_gpio_driver references
	the function __init nmk_gpio_probe()
	If the reference is valid then annotate the
	variable with __init* or __refdata (see linux/init.h) or name the variable:
	*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-nomadik/gpio.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c
index 977c8f9..9bc1646 100644
--- a/arch/arm/plat-nomadik/gpio.c
+++ b/arch/arm/plat-nomadik/gpio.c
@@ -624,14 +624,13 @@ static struct platform_driver nmk_gpio_driver = {
 		.owner = THIS_MODULE,
 		.name = "gpio",
 		},
-	.probe = nmk_gpio_probe,
 	.suspend = NULL, /* to be done */
 	.resume = NULL,
 };
 
 static int __init nmk_gpio_init(void)
 {
-	return platform_driver_register(&nmk_gpio_driver);
+	return platform_driver_probe(&nmk_gpio_driver, nmk_gpio_probe);
 }
 
 core_initcall(nmk_gpio_init);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 17/19] ARM: s3c64xx: don't put smartq5_leds in .init.data
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (16 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

This fixes a section mismatch found by modpost:

	WARNING: arch/arm/mach-s3c64xx/built-in.o(.data+0x2814): Section mismatch in reference from the variable smartq5_led_data to the (unknown reference) .init.data:(unknown)
	The variable smartq5_led_data references
	the (unknown reference) __initdata (unknown)
	If the reference is valid then annotate the
	variable with __init* or __refdata (see linux/init.h) or name the variable:
	*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-s3c64xx/mach-smartq5.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index 1d0326e..76deb8c 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -58,7 +58,7 @@ static struct platform_device smartq5_lcd_control_device = {
 	.dev.platform_data	= &smartq5_lcd_control,
 };
 
-static struct gpio_led smartq5_leds[] __initdata = {
+static struct gpio_led smartq5_leds[] = {
 	{
 		.name			= "smartq5:green",
 		.active_low		= 1,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 18/19] ARM: s3c64xx: don't put smartq7_leds in .init.data
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (17 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

This fixes a section mismatch found by modpost:

	WARNING: arch/arm/mach-s3c64xx/built-in.o(.data+0x2c1c): Section mismatch in reference from the variable smartq7_led_data to the (unknown reference) .init.data:(unknown)
	The variable smartq7_led_data references
	the (unknown reference) __initdata (unknown)
	If the reference is valid then annotate the
	variable with __init* or __refdata (see linux/init.h) or name the variable:
	*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-s3c64xx/mach-smartq7.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index e0bc78e..34e846b 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -58,7 +58,7 @@ static struct platform_device smartq7_lcd_control_device = {
 	.dev.platform_data	= &smartq7_lcd_control,
 };
 
-static struct gpio_led smartq7_leds[] __initdata = {
+static struct gpio_led smartq7_leds[] = {
 	{
 		.name			= "smartq7:red",
 		.active_low		= 1,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 19/19] ARM: s3c64xx: don't put smartq_bl_init in .init.text
  2010-08-05 14:08   ` Uwe Kleine-König
                     ` (18 preceding siblings ...)
  (?)
@ 2010-08-05 14:08   ` Uwe Kleine-König
  -1 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

This fixes a section mismatch found by modpost:

	WARNING: arch/arm/mach-s3c64xx/built-in.o(.data+0x2498): Section mismatch in reference from the variable smartq_backlight_data to the function .init.text:smartq_bl_init()
	The variable smartq_backlight_data references
	the function __init smartq_bl_init()
	If the reference is valid then annotate the
	variable with __init* or __refdata (see linux/init.h) or name the variable:
	*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-s3c64xx/mach-smartq.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index 028d080..b0bb9fb 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -135,7 +135,7 @@ static struct platform_device smartq_usb_otg_vbus_dev = {
 	.dev.platform_data	= &smartq_usb_otg_vbus_pdata,
 };
 
-static int __init smartq_bl_init(struct device *dev)
+static int smartq_bl_init(struct device *dev)
 {
     s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2));
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 14/19] usb gadget: don't save bind callback in struct usb_configuration
  2010-08-05 14:08   ` [PATCH 14/19] usb gadget: don't save bind callback in struct usb_configuration Uwe Kleine-König
@ 2010-08-05 14:21     ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-08-05 14:21 UTC (permalink / raw)
  To: linux-arm-kernel

Greg, Micha?,

On Thu, Aug 05, 2010 at 04:08:48PM +0200, Uwe Kleine-K?nig wrote:
> The bind function is only called at init time so there is no need to
> save a pointer to it in the driver struct.
> 
> This fixes many section mismatches reported by modpost.
Argh, this is the old commit log.  Please take the patch I sent earlier
to lkml and linux-usb

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 15/19] SPI: amba-pl022: move probe and remove to .devinit and .devexit resp.
  2010-08-05 14:08   ` [PATCH 15/19] SPI: amba-pl022: move probe and remove to .devinit and .devexit resp Uwe Kleine-König
@ 2010-08-05 17:14     ` Kevin Wells
  0 siblings, 0 replies; 81+ messages in thread
From: Kevin Wells @ 2010-08-05 17:14 UTC (permalink / raw)
  To: linux-arm-kernel

> The driver can be bound via sysfs after the .init sections are already
> discarded, so pl022_probe must not be in .init.text.  If there is no
> remove
> function the driver can still be unbound without any callback being run.
> So pl022_remove must not be in .exit.text.
> 
> This fixes a section mismatch reported by modpost.
> 

This fix was in Grant Likely's spi tree earlier this week.

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe
  2010-08-05 14:08   ` [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe Uwe Kleine-König
@ 2010-08-09  6:59     ` Rabin VINCENT
  2010-09-02 13:50       ` [PATCH] ARM: nomadik: move nmk_gpio_probe to .devinit.text Uwe Kleine-König
  2010-09-02 10:30     ` [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe Linus Walleij
  1 sibling, 1 reply; 81+ messages in thread
From: Rabin VINCENT @ 2010-08-09  6:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 05, 2010 at 16:08:50 +0200, Uwe Kleine-K?nig wrote:
> diff --git a/arch/arm/plat-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c
> index 977c8f9..9bc1646 100644
> --- a/arch/arm/plat-nomadik/gpio.c
> +++ b/arch/arm/plat-nomadik/gpio.c
> @@ -624,14 +624,13 @@ static struct platform_driver nmk_gpio_driver = {
>  		.owner = THIS_MODULE,
>  		.name = "gpio",
>  		},
> -	.probe = nmk_gpio_probe,
>  	.suspend = NULL, /* to be done */
>  	.resume = NULL,
>  };
>  
>  static int __init nmk_gpio_init(void)
>  {
> -	return platform_driver_register(&nmk_gpio_driver);
> +	return platform_driver_probe(&nmk_gpio_driver, nmk_gpio_probe);
>  }
>  
>  core_initcall(nmk_gpio_init);

This won't quite work, because this is a core_initcall (intentionally),
and the platform devices are not yet registered when nmk_gpio_init() is
called.  nmk_gpio_probe() could be moved to __devinit to fix the modpost
warning.

Rabin

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 11/19] ARM: cam60: move cam60_spi_devices to .init.data
  2010-08-05 14:08   ` [PATCH 11/19] ARM: cam60: move cam60_spi_devices to .init.data Uwe Kleine-König
@ 2010-08-10 19:33     ` avictor.za at gmail.com
  0 siblings, 0 replies; 81+ messages in thread
From: avictor.za at gmail.com @ 2010-08-10 19:33 UTC (permalink / raw)
  To: linux-arm-kernel

hi Uwe,

> cam60_spi_devices is passed to at91_add_device_spi which calls
> spi_register_board_info. ?The latter makes a copy of it, so living in
> .init.data is OK.
>
> This fixes the following warning in cam60_defconfig:
> ? ? ? ?WARNING: vmlinux.o(.data+0x2a00): Section mismatch in reference from the variable cam60_spi_devices to the (unknown reference) .init.data:(unknown)
> ? ? ? ?The variable cam60_spi_devices references
> ? ? ? ?the (unknown reference) __initdata (unknown)
> ? ? ? ?If the reference is valid then annotate the
> ? ? ? ?variable with __init* or __refdata (see linux/init.h) or name the variable:
> ? ? ? ?*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

Acked-by: Andrew Victor <linux@maxim.org.za>

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 12/19] ARM: cam60: don't use __init for cam60_spi_{flash_platform_data, partitions}
  2010-08-05 14:08   ` [PATCH 12/19] ARM: cam60: don't use __init for cam60_spi_{flash_platform_data, partitions} Uwe Kleine-König
@ 2010-08-10 19:37     ` avictor.za at gmail.com
  0 siblings, 0 replies; 81+ messages in thread
From: avictor.za at gmail.com @ 2010-08-10 19:37 UTC (permalink / raw)
  To: linux-arm-kernel

hi Uwe,

> These two structs are referenced by cam60_spi_devices. ?The latter is
> copied at init time to kmalloced memory and so the copy isn't freed after
> booting. ?So it must not contain references to .init memory.
>
> This isn't noticed by modpost as cam60_spi_devices is in .init.data, too.
>
> Noticed-by: Andrew Victor <avictor.za@gmail.com>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

Acked-by: Andrew Victor <linux@maxim.org.za>

Please submit to Russell King's patch-system .

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 02/19] ARM: sa1111: move __sa1111_probe() to .devinit.text
  2010-08-05 14:08   ` [PATCH 02/19] ARM: sa1111: move __sa1111_probe() to .devinit.text Uwe Kleine-König
@ 2010-09-01 10:02     ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-09-01 10:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Russell,

On Thu, Aug 05, 2010 at 04:08:36PM +0200, Uwe Kleine-K?nig wrote:
> __sa1111_probe is only called by sa1111_probe that lives in .devinit.text.
> So it's save to move the former to .devinit.text, too.
> 
> Acked-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Should/can I send the fixes in this series that are not yet in mainline to
your patch system?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe
  2010-08-05 14:08   ` [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe Uwe Kleine-König
  2010-08-09  6:59     ` Rabin VINCENT
@ 2010-09-02 10:30     ` Linus Walleij
  2010-09-02 10:50       ` Uwe Kleine-König
  2010-09-02 14:42       ` Russell King - ARM Linux
  1 sibling, 2 replies; 81+ messages in thread
From: Linus Walleij @ 2010-09-02 10:30 UTC (permalink / raw)
  To: linux-arm-kernel

2010/8/5 Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>:

> This fixes a section mismatch reported by modpost:

Uwe, why have you put this into Russells patch tracker without taking
into account the issues raised by Rabin?

PLS find a proper fix, thanks.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe
  2010-09-02 10:30     ` [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe Linus Walleij
@ 2010-09-02 10:50       ` Uwe Kleine-König
  2010-09-02 14:42       ` Russell King - ARM Linux
  1 sibling, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-09-02 10:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Linus,

On Thu, Sep 02, 2010 at 12:30:22PM +0200, Linus Walleij wrote:
> 2010/8/5 Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>:
> 
> > This fixes a section mismatch reported by modpost:
> 
> Uwe, why have you put this into Russells patch tracker without taking
> into account the issues raised by Rabin?
Oh sorry, overlooked that when resorting my patches.  Will send a fix
after lunch.

Best regards and thanks for noticing,
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH] ARM: nomadik: move nmk_gpio_probe to .devinit.text
  2010-08-09  6:59     ` Rabin VINCENT
@ 2010-09-02 13:50       ` Uwe Kleine-König
  2010-09-02 14:55         ` Rabin Vincent
  0 siblings, 1 reply; 81+ messages in thread
From: Uwe Kleine-König @ 2010-09-02 13:50 UTC (permalink / raw)
  To: linux-arm-kernel

This fixes a section mismatch reported by modpost:

	WARNING: arch/arm/plat-nomadik/built-in.o(.data+0x100): Section mismatch in reference from the variable nmk_gpio_driver to the function .init.text:nmk_gpio_probe()
	The variable nmk_gpio_driver references
	the function __init nmk_gpio_probe()
	If the reference is valid then annotate the
	variable with __init* or __refdata (see linux/init.h) or name the variable:
	*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

According to Rabin VINCENT the alternative to use platform_driver_probe
won't work because the "platform devices are not yet registered when
nmk_gpio_init() is called."

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
Hello Rabin,

sorry for ignoring your review, it wasn't on purpose.  Here comes a
fixed up version.  If this is OK for you, I'd post this as 6347/2.

Best regards
Uwe

 arch/arm/plat-nomadik/gpio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c
index 977c8f9..7c7c1f1 100644
--- a/arch/arm/plat-nomadik/gpio.c
+++ b/arch/arm/plat-nomadik/gpio.c
@@ -534,7 +534,7 @@ static struct gpio_chip nmk_gpio_template = {
 	.can_sleep		= 0,
 };
 
-static int __init nmk_gpio_probe(struct platform_device *dev)
+static int __devinit nmk_gpio_probe(struct platform_device *dev)
 {
 	struct nmk_gpio_platform_data *pdata = dev->dev.platform_data;
 	struct nmk_gpio_chip *nmk_chip;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

* [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe
  2010-09-02 10:30     ` [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe Linus Walleij
  2010-09-02 10:50       ` Uwe Kleine-König
@ 2010-09-02 14:42       ` Russell King - ARM Linux
  1 sibling, 0 replies; 81+ messages in thread
From: Russell King - ARM Linux @ 2010-09-02 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 02, 2010 at 12:30:22PM +0200, Linus Walleij wrote:
> 2010/8/5 Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>:
> 
> > This fixes a section mismatch reported by modpost:
> 
> Uwe, why have you put this into Russells patch tracker without taking
> into account the issues raised by Rabin?

I've just discarded that fix - luckily I'd read the majority of list
traffic before starting to process some of the patch backlog, and
remembered this issue.

^ permalink raw reply	[flat|nested] 81+ messages in thread

* [PATCH] ARM: nomadik: move nmk_gpio_probe to .devinit.text
  2010-09-02 13:50       ` [PATCH] ARM: nomadik: move nmk_gpio_probe to .devinit.text Uwe Kleine-König
@ 2010-09-02 14:55         ` Rabin Vincent
  2010-09-02 15:13           ` (Patch #6347) " Uwe Kleine-König
  0 siblings, 1 reply; 81+ messages in thread
From: Rabin Vincent @ 2010-09-02 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Uwe,

2010/9/2 Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>:
> This fixes a section mismatch reported by modpost:
>
> ? ? ? ?WARNING: arch/arm/plat-nomadik/built-in.o(.data+0x100): Section mismatch in reference from the variable nmk_gpio_driver to the function .init.text:nmk_gpio_probe()
> ? ? ? ?The variable nmk_gpio_driver references
> ? ? ? ?the function __init nmk_gpio_probe()
> ? ? ? ?If the reference is valid then annotate the
> ? ? ? ?variable with __init* or __refdata (see linux/init.h) or name the variable:
> ? ? ? ?*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
>
> According to Rabin VINCENT the alternative to use platform_driver_probe
> won't work because the "platform devices are not yet registered when
> nmk_gpio_init() is called."
>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

Acked-by: Rabin Vincent <rabin.vincent@stericsson.com>

Thanks,
Rabin

^ permalink raw reply	[flat|nested] 81+ messages in thread

* (Patch #6347) ARM: nomadik: move nmk_gpio_probe to .devinit.text
  2010-09-02 14:55         ` Rabin Vincent
@ 2010-09-02 15:13           ` Uwe Kleine-König
  0 siblings, 0 replies; 81+ messages in thread
From: Uwe Kleine-König @ 2010-09-02 15:13 UTC (permalink / raw)
  To: linux-arm-kernel

This fixes a section mismatch reported by modpost:

	WARNING: arch/arm/plat-nomadik/built-in.o(.data+0x100): Section mismatch in reference from the variable nmk_gpio_driver to the function .init.text:nmk_gpio_probe()
	The variable nmk_gpio_driver references
	the function __init nmk_gpio_probe()
	If the reference is valid then annotate the
	variable with __init* or __refdata (see linux/init.h) or name the variable:
	*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

According to Rabin VINCENT the alternative to use platform_driver_probe
won't work because the "platform devices are not yet registered when
nmk_gpio_init() is called."

Acked-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
KernelVersion: 2.6.36-rc3

 arch/arm/plat-nomadik/gpio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c
index 977c8f9..7c7c1f1 100644
--- a/arch/arm/plat-nomadik/gpio.c
+++ b/arch/arm/plat-nomadik/gpio.c
@@ -534,7 +534,7 @@ static struct gpio_chip nmk_gpio_template = {
 	.can_sleep		= 0,
 };
 
-static int __init nmk_gpio_probe(struct platform_device *dev)
+static int __devinit nmk_gpio_probe(struct platform_device *dev)
 {
 	struct nmk_gpio_platform_data *pdata = dev->dev.platform_data;
 	struct nmk_gpio_chip *nmk_chip;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 81+ messages in thread

end of thread, other threads:[~2010-09-02 15:13 UTC | newest]

Thread overview: 81+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-23 19:58 [PATCH 01/11] ARM: cam60: move cam60_spi_devices to .init.data Uwe Kleine-König
2010-07-23 19:58 ` Uwe Kleine-König
2010-07-23 19:58 ` [PATCH 02/11] ARM: kirkwood: move qnap_tsx1x_register_flash() to .init.text Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-24  2:37   ` Nicolas Pitre
2010-07-24  2:37     ` Nicolas Pitre
2010-07-23 19:58 ` [PATCH 03/11] ARM: sa1111: move __sa1111_probe() to .devinit.text Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 20:23   ` Kristoffer Ericson
2010-07-23 20:23     ` Kristoffer Ericson
2010-07-23 19:58 ` [PATCH 04/11] ARM: omap: move omap_init_fb to .init.text Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 19:58 ` [PATCH 05/11] ARM: omap1: nokia770: move mipid_dev_init() " Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 19:58 ` [PATCH 06/11] ARM: omap: move omapfb_reserve_sdram() " Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 21:15   ` Russell King - ARM Linux
2010-07-23 21:15     ` Russell King - ARM Linux
2010-07-23 21:15     ` Russell King - ARM Linux
2010-07-24  8:51     ` Uwe Kleine-König
2010-07-24  8:51       ` Uwe Kleine-König
2010-07-23 19:58 ` [PATCH 07/11] ARM: omap: move omapfb_reserve_sram() " Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 21:15   ` Russell King - ARM Linux
2010-07-23 21:15     ` Russell King - ARM Linux
2010-07-23 21:15     ` Russell King - ARM Linux
2010-07-23 19:58 ` [PATCH 08/11] ARM: omap: move get_fbmem_region() " Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 21:16   ` Russell King - ARM Linux
2010-07-23 21:16     ` Russell King - ARM Linux
2010-07-23 21:16     ` Russell King - ARM Linux
2010-07-23 19:58 ` [PATCH 09/11] ARM: omap: move omap_get_config et al. " Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 19:58 ` [PATCH 10/11] wip: ARM: omap: move omap_board_config_kernel to .init.data Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 19:58 ` [PATCH 11/11] ARM: omap: ams-delta: move config " Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-07-23 19:58   ` Uwe Kleine-König
2010-08-01 21:23 ` [PATCH 01/11] ARM: cam60: move cam60_spi_devices " avictor.za
2010-08-01 21:23   ` avictor.za at gmail.com
2010-08-02  5:26   ` Uwe Kleine-König
2010-08-02  5:26     ` Uwe Kleine-König
2010-08-02  7:59     ` [PATCH] ARM: cam60: don't use __init for cam60_spi_{flash_platform_data, partitions} Uwe Kleine-König
2010-08-05 14:08 ` [PATCH 00/19] More section fixes [Was: Re: [PATCH 01/11] ARM: cam60: move cam60_spi_devices to .init.data] Uwe Kleine-König
2010-08-05 14:08   ` Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 01/19] wip: enable DEBUG_SECTION_MISMATCH Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 02/19] ARM: sa1111: move __sa1111_probe() to .devinit.text Uwe Kleine-König
2010-09-01 10:02     ` Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 03/19] ARM: omap: move omap_init_fb to .init.text Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 04/19] ARM: omap1: nokia770: move mipid_dev_init() " Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 05/19] ARM: omap: move get_fbmem_region() " Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 06/19] ARM: omap: move omap_get_config et al. " Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 07/19] wip: ARM: omap: move omap_board_config_kernel to .init.data Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 08/19] ARM: omap: ams-delta: move config " Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 09/19] MTD: pxa2xx: move pxa2xx_flash_probe to .devinit.text Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 10/19] VIDEO: sa1100fb: register driver using platform_driver_probe Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 11/19] ARM: cam60: move cam60_spi_devices to .init.data Uwe Kleine-König
2010-08-10 19:33     ` avictor.za at gmail.com
2010-08-05 14:08   ` [PATCH 12/19] ARM: cam60: don't use __init for cam60_spi_{flash_platform_data, partitions} Uwe Kleine-König
2010-08-10 19:37     ` avictor.za at gmail.com
2010-08-05 14:08   ` [PATCH 13/19] usb gadget: don't save bind callback in struct usb_gadget_driver Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 14/19] usb gadget: don't save bind callback in struct usb_configuration Uwe Kleine-König
2010-08-05 14:21     ` Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 15/19] SPI: amba-pl022: move probe and remove to .devinit and .devexit resp Uwe Kleine-König
2010-08-05 17:14     ` Kevin Wells
2010-08-05 14:08   ` [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe Uwe Kleine-König
2010-08-09  6:59     ` Rabin VINCENT
2010-09-02 13:50       ` [PATCH] ARM: nomadik: move nmk_gpio_probe to .devinit.text Uwe Kleine-König
2010-09-02 14:55         ` Rabin Vincent
2010-09-02 15:13           ` (Patch #6347) " Uwe Kleine-König
2010-09-02 10:30     ` [PATCH 16/19] ARM: nomadik: register nmk_gpio_driver using platform_driver_probe Linus Walleij
2010-09-02 10:50       ` Uwe Kleine-König
2010-09-02 14:42       ` Russell King - ARM Linux
2010-08-05 14:08   ` [PATCH 17/19] ARM: s3c64xx: don't put smartq5_leds in .init.data Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 18/19] ARM: s3c64xx: don't put smartq7_leds " Uwe Kleine-König
2010-08-05 14:08   ` [PATCH 19/19] ARM: s3c64xx: don't put smartq_bl_init in .init.text Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.