diff options
author | Paul Cercueil <paul@crapouillou.net> | 2019-06-28 21:22:48 -0400 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2019-07-01 08:50:38 -0400 |
commit | c403ec33b613a15d9fd8dde37f246b79cd56b5df (patch) | |
tree | eaa0519c1926331853be0a008249882f4812d0bc | |
parent | a126483e82957172b8a93ebb1d30fb2b1df3cbbc (diff) |
mtd: rawnand: ingenic: Fix ingenic_ecc dependency
If MTD_NAND_JZ4780 is y and MTD_NAND_JZ4780_BCH is m,
which select CONFIG_MTD_NAND_INGENIC_ECC to m, building fails:
drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_remove':
ingenic_nand.c:(.text+0x177): undefined reference to `ingenic_ecc_release'
drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_ecc_correct':
ingenic_nand.c:(.text+0x2ee): undefined reference to `ingenic_ecc_correct'
To fix that, the ingenic_nand and ingenic_ecc modules have been fused
into one single module.
- The ingenic_ecc.c code is now compiled in only if
$(CONFIG_MTD_NAND_INGENIC_ECC) is set. This is now a boolean instead
of tristate.
- To avoid changing the module name, the ingenic_nand.c file is moved to
ingenic_nand_drv.c. Then the module name is still ingenic_nand.
- Since ingenic_ecc.c is no more a module, the module-specific macros
have been dropped, and the functions are no more exported for use by
the ingenic_nand driver.
Fixes: 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and SoC specific code")
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Hulk Robot <hulkci@huawei.com>
Cc: YueHaibing <yuehaibing@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
-rw-r--r-- | drivers/mtd/nand/raw/ingenic/Kconfig | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/raw/ingenic/Makefile | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/raw/ingenic/ingenic_ecc.c | 9 | ||||
-rw-r--r-- | drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c (renamed from drivers/mtd/nand/raw/ingenic/ingenic_nand.c) | 0 |
4 files changed, 4 insertions, 11 deletions
diff --git a/drivers/mtd/nand/raw/ingenic/Kconfig b/drivers/mtd/nand/raw/ingenic/Kconfig index 19a96ce515c1..66b7cffdb0c2 100644 --- a/drivers/mtd/nand/raw/ingenic/Kconfig +++ b/drivers/mtd/nand/raw/ingenic/Kconfig | |||
@@ -16,7 +16,7 @@ config MTD_NAND_JZ4780 | |||
16 | if MTD_NAND_JZ4780 | 16 | if MTD_NAND_JZ4780 |
17 | 17 | ||
18 | config MTD_NAND_INGENIC_ECC | 18 | config MTD_NAND_INGENIC_ECC |
19 | tristate | 19 | bool |
20 | 20 | ||
21 | config MTD_NAND_JZ4740_ECC | 21 | config MTD_NAND_JZ4740_ECC |
22 | tristate "Hardware BCH support for JZ4740 SoC" | 22 | tristate "Hardware BCH support for JZ4740 SoC" |
diff --git a/drivers/mtd/nand/raw/ingenic/Makefile b/drivers/mtd/nand/raw/ingenic/Makefile index 1ac4f455baea..b63d36889263 100644 --- a/drivers/mtd/nand/raw/ingenic/Makefile +++ b/drivers/mtd/nand/raw/ingenic/Makefile | |||
@@ -2,7 +2,9 @@ | |||
2 | obj-$(CONFIG_MTD_NAND_JZ4740) += jz4740_nand.o | 2 | obj-$(CONFIG_MTD_NAND_JZ4740) += jz4740_nand.o |
3 | obj-$(CONFIG_MTD_NAND_JZ4780) += ingenic_nand.o | 3 | obj-$(CONFIG_MTD_NAND_JZ4780) += ingenic_nand.o |
4 | 4 | ||
5 | obj-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o | 5 | ingenic_nand-y += ingenic_nand_drv.o |
6 | ingenic_nand-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o | ||
7 | |||
6 | obj-$(CONFIG_MTD_NAND_JZ4740_ECC) += jz4740_ecc.o | 8 | obj-$(CONFIG_MTD_NAND_JZ4740_ECC) += jz4740_ecc.o |
7 | obj-$(CONFIG_MTD_NAND_JZ4725B_BCH) += jz4725b_bch.o | 9 | obj-$(CONFIG_MTD_NAND_JZ4725B_BCH) += jz4725b_bch.o |
8 | obj-$(CONFIG_MTD_NAND_JZ4780_BCH) += jz4780_bch.o | 10 | obj-$(CONFIG_MTD_NAND_JZ4780_BCH) += jz4780_bch.o |
diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c index d3e085c5685a..c954189606f6 100644 --- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c +++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c | |||
@@ -30,7 +30,6 @@ int ingenic_ecc_calculate(struct ingenic_ecc *ecc, | |||
30 | { | 30 | { |
31 | return ecc->ops->calculate(ecc, params, buf, ecc_code); | 31 | return ecc->ops->calculate(ecc, params, buf, ecc_code); |
32 | } | 32 | } |
33 | EXPORT_SYMBOL(ingenic_ecc_calculate); | ||
34 | 33 | ||
35 | /** | 34 | /** |
36 | * ingenic_ecc_correct() - detect and correct bit errors | 35 | * ingenic_ecc_correct() - detect and correct bit errors |
@@ -51,7 +50,6 @@ int ingenic_ecc_correct(struct ingenic_ecc *ecc, | |||
51 | { | 50 | { |
52 | return ecc->ops->correct(ecc, params, buf, ecc_code); | 51 | return ecc->ops->correct(ecc, params, buf, ecc_code); |
53 | } | 52 | } |
54 | EXPORT_SYMBOL(ingenic_ecc_correct); | ||
55 | 53 | ||
56 | /** | 54 | /** |
57 | * ingenic_ecc_get() - get the ECC controller device | 55 | * ingenic_ecc_get() - get the ECC controller device |
@@ -111,7 +109,6 @@ struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *of_node) | |||
111 | } | 109 | } |
112 | return ecc; | 110 | return ecc; |
113 | } | 111 | } |
114 | EXPORT_SYMBOL(of_ingenic_ecc_get); | ||
115 | 112 | ||
116 | /** | 113 | /** |
117 | * ingenic_ecc_release() - release the ECC controller device | 114 | * ingenic_ecc_release() - release the ECC controller device |
@@ -122,7 +119,6 @@ void ingenic_ecc_release(struct ingenic_ecc *ecc) | |||
122 | clk_disable_unprepare(ecc->clk); | 119 | clk_disable_unprepare(ecc->clk); |
123 | put_device(ecc->dev); | 120 | put_device(ecc->dev); |
124 | } | 121 | } |
125 | EXPORT_SYMBOL(ingenic_ecc_release); | ||
126 | 122 | ||
127 | int ingenic_ecc_probe(struct platform_device *pdev) | 123 | int ingenic_ecc_probe(struct platform_device *pdev) |
128 | { | 124 | { |
@@ -159,8 +155,3 @@ int ingenic_ecc_probe(struct platform_device *pdev) | |||
159 | return 0; | 155 | return 0; |
160 | } | 156 | } |
161 | EXPORT_SYMBOL(ingenic_ecc_probe); | 157 | EXPORT_SYMBOL(ingenic_ecc_probe); |
162 | |||
163 | MODULE_AUTHOR("Alex Smith <alex@alex-smith.me.uk>"); | ||
164 | MODULE_AUTHOR("Harvey Hunt <harveyhuntnexus@gmail.com>"); | ||
165 | MODULE_DESCRIPTION("Ingenic ECC common driver"); | ||
166 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_nand.c b/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c index d7b7c0f13909..d7b7c0f13909 100644 --- a/drivers/mtd/nand/raw/ingenic/ingenic_nand.c +++ b/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c | |||