From patchwork Tue Sep 3 02:37:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 272101 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1F11C2C0091 for ; Tue, 3 Sep 2013 12:38:24 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VGgVM-0000yp-JR; Tue, 03 Sep 2013 02:38:08 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VGgVK-00043u-Uy; Tue, 03 Sep 2013 02:38:06 +0000 Received: from top.free-electrons.com ([176.31.233.9] helo=mail.free-electrons.com) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VGgVI-00043H-UA for linux-mtd@lists.infradead.org; Tue, 03 Sep 2013 02:38:05 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 65FF9850; Tue, 3 Sep 2013 04:38:05 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.3.2 Received: from localhost.localdomain (unknown [190.2.109.158]) by mail.free-electrons.com (Postfix) with ESMTPA id 01D10823; Tue, 3 Sep 2013 04:38:02 +0200 (CEST) From: Ezequiel Garcia To: , Subject: [PATCH] of_mtd: Add no-op stubs to support CONFIG_OF=n Date: Mon, 2 Sep 2013 23:37:53 -0300 Message-Id: <1378175873-2763-1-git-send-email-ezequiel.garcia@free-electrons.com> X-Mailer: git-send-email 1.8.1.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130902_223805_111087_9B8D8A2F X-CRM114-Status: UNSURE ( 7.48 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -3.7 (---) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-3.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -2.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Josh Wu , Brian Norris , David Woodhouse , Ezequiel Garcia , Artem Bityutskiy X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Just like the rest of the subsystems, let's add the required no-op functions to implement stubs when CONFIG_OF=n. This prevents MTD drivers from having ugly ifdefs in their code, and instead hide the ifdef monster in the header closet (far away from people's sight). Signed-off-by: Ezequiel Garcia --- include/linux/of_mtd.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h index ed7f267..66f173e 100644 --- a/include/linux/of_mtd.h +++ b/include/linux/of_mtd.h @@ -14,6 +14,21 @@ int of_get_nand_ecc_mode(struct device_node *np); int of_get_nand_bus_width(struct device_node *np); bool of_get_nand_on_flash_bbt(struct device_node *np); +#else +static inline int of_get_nand_ecc_mode(struct device_node *np) +{ + return -ENOSYS; +} + +static inline int of_get_nand_bus_width(struct device_node *np) +{ + return -ENOSYS; +} + +static inline bool of_get_nand_on_flash_bbt(struct device_node *np) +{ + return false; +} #endif #endif /* __LINUX_OF_MTD_H */