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 <[email protected]>
---
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
Most other boards have their config in .init.data, too, so this should
be OK.
Signed-off-by: Uwe Kleine-König <[email protected]>
---
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
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 <[email protected]>
---
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
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
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 <[email protected]>
---
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
omap_init_fb() is only called as arch_initcall and so can live in
.init.text.
Signed-off-by: Uwe Kleine-König <[email protected]>
---
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
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 <[email protected]>
---
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
__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 <[email protected]>
---
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
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 <[email protected]>
---
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
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 <[email protected]>
---
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
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 <[email protected]>
---
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
you beat me to it :)
Acked-by: Kristoffer Ericson <[email protected]>
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 <[email protected]>
> ---
> 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
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.
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.)
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.
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 <[email protected]>
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
>
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/ |
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",
Hi Andrew,
On Sun, Aug 01, 2010 at 11:23:35PM +0200, [email protected] 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/ |
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/ |