From patchwork Tue Sep 30 12:04:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 394919 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 816641400BB for ; Tue, 30 Sep 2014 22:06:02 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XYwAm-0006z1-Tm; Tue, 30 Sep 2014 12:04:52 +0000 Received: from mout.kundenserver.de ([212.227.126.187]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XYwAk-0006tz-Nu; Tue, 30 Sep 2014 12:04:51 +0000 Received: from wuerfel.localnet (HSI-KBW-134-3-133-35.hsi14.kabel-badenwuerttemberg.de [134.3.133.35]) by mrelayeu.kundenserver.de (node=mreue006) with ESMTP (Nemesis) id 0LcrJc-1XzEVW33B2-00i8vH; Tue, 30 Sep 2014 14:04:18 +0200 From: Arnd Bergmann To: Brian Norris Subject: [PATCH] nand: omap2: fix building with CONFIG_MTD_NAND_OMAP_BCH=m Date: Tue, 30 Sep 2014 14:04:17 +0200 Message-ID: <1811108.CcWEs0vKNL@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V02:K0:2aFlPRr5mIPfqx4v/voxlIZptNnxuSjAwDaiTRV4q1p FlzdYYE3GF38Edn0VJ5+ftj7cLkjU3xTIAH2mJVApIwhXFV5Og /QZ4Sz9Fk3S4h/9geWzHUk4Rx0LgIF66OoP+LB8ss8GdorQ/V9 ebwi4bx+HTBKV+Ij8lWjZjQLmYxDKoTy353Y7EC9xK805Juvx9 z9n1Md9sieEbc6MNJ2TlSE1LkOryjB1on776tgfYOf5WqY1YjE gyhmf73IvDFFosQhbQvKYWHNJDuZSiO6iUtEXkoFbr/BE+hDQS 6lp/a821CX6k0BidKO1NFBAQupigp0xoOoZwJTp7hDdI20p2pp YmSUUNGb199k3gXMbup8= X-UI-Out-Filterresults: notjunk:1; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140930_050451_118508_B58DC1A4 X-CRM114-Status: UNSURE ( 9.26 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.187 listed in list.dnswl.org] -0.2 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.126.187 listed in wl.mailspike.net] Cc: linux-mtd@lists.infradead.org, pekon gupta , Ezequiel Garcia , David Woodhouse , linux-arm-kernel@lists.infradead.org, Roger Quadros X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 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,