Skip to content

Commit 166cd44

Browse files
geertuBoris Brezillon
authored andcommitted
mtd: rawnand: docg4: Remove wrong __init annotations
If gcc (e.g. 4.1.2) decides not to inline init_mtd_structs() and read_id_reg(), this will cause section mismatches, and crashes: WARNING: drivers/mtd/nand/raw/docg4.o(.text+0xc10): Section mismatch in reference from the function docg4_attach_chip() to the function .init.text:init_mtd_structs() The function docg4_attach_chip() references the function __init init_mtd_structs(). This is often because docg4_attach_chip lacks a __init annotation or the annotation of init_mtd_structs is wrong. WARNING: drivers/mtd/nand/raw/docg4.o(.text+0xc3e): Section mismatch in reference from the function docg4_attach_chip() to the function .init.text:read_id_reg() The function docg4_attach_chip() references the function __init read_id_reg(). This is often because docg4_attach_chip lacks a __init annotation or the annotation of read_id_reg is wrong. Fix this by dropping the now incorrect __init annotations from init_mtd_structs() and read_id_reg(). Fixes: 66a3847 ("mtd: rawnand: docg4: convert driver to nand_scan()") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
1 parent 5b394b2 commit 166cd44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mtd/nand/raw/docg4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ static int docg4_resume(struct platform_device *pdev)
12181218
return 0;
12191219
}
12201220

1221-
static void __init init_mtd_structs(struct mtd_info *mtd)
1221+
static void init_mtd_structs(struct mtd_info *mtd)
12221222
{
12231223
/* initialize mtd and nand data structures */
12241224

@@ -1290,7 +1290,7 @@ static void __init init_mtd_structs(struct mtd_info *mtd)
12901290

12911291
}
12921292

1293-
static int __init read_id_reg(struct mtd_info *mtd)
1293+
static int read_id_reg(struct mtd_info *mtd)
12941294
{
12951295
struct nand_chip *nand = mtd_to_nand(mtd);
12961296
struct docg4_priv *doc = nand_get_controller_data(nand);

0 commit comments

Comments
 (0)