From: Arnd Bergmann <arnd@arndb.de>
To: Brian Norris <computersforpeace@gmail.com>
Cc: linux-mtd@lists.infradead.org, pekon gupta <pekon@ti.com>,
Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
David Woodhouse <dwmw2@infradead.org>,
linux-arm-kernel@lists.infradead.org,
Roger Quadros <rogerq@ti.com>
Subject: [PATCH] nand: omap2: fix building with CONFIG_MTD_NAND_OMAP_BCH=m
Date: Tue, 30 Sep 2014 14:04:17 +0200 [thread overview]
Message-ID: <1811108.CcWEs0vKNL@wuerfel> (raw)
If the OMAP nand driver is built-in but the BCH driver is a module,
we get a link-time error:
drivers/built-in.o: In function `omap_elm_correct_data':
:(.text+0x174e88): undefined reference to `elm_decode_bch_error_page'
drivers/built-in.o: In function `omap_nand_probe':
:(.text+0x175b48): undefined reference to `elm_config'
There are two possible ways to deal with this, either prevent that
configuration in Kconfig or make sure we don't reference the ELM
driver in this case.
This patch picks the second approach, which makes it possible to
use the ELM driver in other modules while still having the OMAP
NAND driver built-in.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 93af53b8633c ("nand: omap2: Remove horrible ifdefs to fix module probe")
diff --git a/include/linux/platform_data/elm.h b/include/linux/platform_data/elm.h
index b8686c00f15f..cbca66ce7c10 100644
--- a/include/linux/platform_data/elm.h
+++ b/include/linux/platform_data/elm.h
@@ -42,7 +42,7 @@ struct elm_errorvec {
int error_loc[16];
};
-#if IS_ENABLED(CONFIG_MTD_NAND_OMAP_BCH)
+#if defined(CONFIG_MTD_NAND_OMAP_BCH) || (defined(CONFIG_MTD_NAND_OMAP_BCH_MODULE) && defined(MODULE))
void elm_decode_bch_error_page(struct device *dev, u8 *ecc_calc,
struct elm_errorvec *err_vec);
int elm_config(struct device *dev, enum bch_ecc bch_type,
next reply other threads:[~2014-09-30 12:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-30 12:04 Arnd Bergmann [this message]
2014-10-01 9:32 ` [PATCH] nand: omap2: fix building with CONFIG_MTD_NAND_OMAP_BCH=m Roger Quadros
2014-10-01 9:56 ` Arnd Bergmann
2014-10-01 10:07 ` Roger Quadros
2014-10-01 10:13 ` Arnd Bergmann
2014-10-01 10:24 ` Roger Quadros
2014-10-01 10:25 ` Ezequiel Garcia
2014-10-01 10:24 ` Ezequiel Garcia
2014-10-01 10:46 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1811108.CcWEs0vKNL@wuerfel \
--to=arnd@arndb.de \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=ezequiel.garcia@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=pekon@ti.com \
--cc=rogerq@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox