Skip to contentSkip to conversation

mtd: Fix section mismatch on sst25l

PATCH In review Fabio Estevam 2 participants 2 messages Nov 12, 2010 – Nov 26, 2010 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: Fix section mismatch on sst25l

Building the kernel with 'make CONFIG_DEBUG_SECTION_MISMATCH=y´

resulted in:

WARNING: vmlinux.o(.data+0x15938): Section mismatch in reference from the variable sst25l_driver to the function .init.text:sst25l_probe() The variable sst25l_driver references
the function __init sst25l_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,

Fix the section mismatch.

---
 drivers/mtd/devices/sst25l.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/devices/sst25l.c +1 -1
index 684247a..925b1a9 100644
@@ -375,7 +375,7 @@ static struct flash_info *__init sst25l_match_device(struct spi_device *spi)
 	return flash_info;
 }
 
-static int __init sst25l_probe(struct spi_device *spi)
+static int __devinit sst25l_probe(struct spi_device *spi)
 {
 	struct flash_info *flash_info;
 	struct sst25l_flash *flash;
Signature · 1 line
1.6.0.4
#1 lore raw
Quoted 24 lines · Fabio Estevam

Building the kernel with 'make CONFIG_DEBUG_SECTION_MISMATCH=y´

resulted in:

WARNING: vmlinux.o(.data+0x15938): Section mismatch in reference from the variable sst25l_driver to the function .init.text:sst25l_probe() The variable sst25l_driver references
the function __init sst25l_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,

Fix the section mismatch.

---
 drivers/mtd/devices/sst25l.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/devices/sst25l.c +0 -0
index 684247a..925b1a9 100644

drivers/mtd/devices/sst25l.c static struct flash_info *__init sst25l_match_device(struct spi_device *spi) · line 381

Quoted 8 lines
drivers/mtd/devices/sst25l.c +1 -1
@@ -375,7 +375,7 @@ static struct flash_info *__init sst25l_match_device(struct spi_device *spi)
 	return flash_info;
 }
 
-static int __init sst25l_probe(struct spi_device *spi)
+static int __devinit sst25l_probe(struct spi_device *spi)
 {
 	struct flash_info *flash_info;
 	struct sst25l_flash *flash;

Should then sst25l_match_device be __devinit as well?

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)