Skip to content

Commit e7cd682

Browse files
ezequielgarciacomputersforpeace
authored andcommitted
mtd: nand: Force omap_elm to be built as a module if omap2_nand is a module
This commit adds a hidden option to build the omap_elm as a module, if omap2_nand is a module (and similarly in the built-in case). This fixes the following build error when omap2_nand is chosen built-in, and omap_elm is chosen as a module: drivers/built-in.o: In function `omap_nand_probe': drivers/mtd/nand/omap2.c:2010: undefined reference to `elm_config' drivers/mtd/nand/omap2.c:1980: undefined reference to `elm_config' drivers/mtd/nand/omap2.c:1927: undefined reference to `elm_config' drivers/built-in.o: In function `omap_elm_correct_data': drivers/mtd/nand/omap2.c:1444: undefined reference to `elm_decode_bch_error_page' Reported-by: Arnd Bergmann <[email protected]> Signed-off-by: Ezequiel Garcia <[email protected]> Signed-off-by: Roger Quadros <[email protected]> Signed-off-by: Brian Norris <[email protected]>
1 parent 32f1b7c commit e7cd682

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

drivers/mtd/nand/Kconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ config MTD_NAND_OMAP2
9696

9797
config MTD_NAND_OMAP_BCH
9898
depends on MTD_NAND_OMAP2
99-
tristate "Support hardware based BCH error correction"
99+
bool "Support hardware based BCH error correction"
100100
default n
101101
select BCH
102102
help
@@ -106,6 +106,9 @@ config MTD_NAND_OMAP_BCH
106106
legacy OMAP families like OMAP2xxx, OMAP3xxx do not have ELM engine
107107
so they should not enable this config symbol.
108108

109+
config MTD_NAND_OMAP_BCH_BUILD
110+
def_tristate MTD_NAND_OMAP2 && MTD_NAND_OMAP_BCH
111+
109112
config MTD_NAND_IDS
110113
tristate
111114

drivers/mtd/nand/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ obj-$(CONFIG_MTD_NAND_NDFC) += ndfc.o
2727
obj-$(CONFIG_MTD_NAND_ATMEL) += atmel_nand.o
2828
obj-$(CONFIG_MTD_NAND_GPIO) += gpio.o
2929
obj-$(CONFIG_MTD_NAND_OMAP2) += omap2.o
30-
obj-$(CONFIG_MTD_NAND_OMAP_BCH) += omap_elm.o
30+
obj-$(CONFIG_MTD_NAND_OMAP_BCH_BUILD) += omap_elm.o
3131
obj-$(CONFIG_MTD_NAND_CM_X270) += cmx270_nand.o
3232
obj-$(CONFIG_MTD_NAND_PXA3xx) += pxa3xx_nand.o
3333
obj-$(CONFIG_MTD_NAND_TMIO) += tmio_nand.o

0 commit comments

Comments
 (0)