From patchwork Fri May 31 22:22:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2646001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id CBF9A3FD4E for ; Fri, 31 May 2013 22:28:30 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiXlj-0007De-Um; Fri, 31 May 2013 22:25:57 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiXkb-0004Md-Im; Fri, 31 May 2013 22:24:45 +0000 Received: from moutng.kundenserver.de ([212.227.17.8]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiXjP-0004AW-8L for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2013 22:23:35 +0000 Received: from wuerfel.lan (HSI-KBW-095-208-002-043.hsi5.kabel-badenwuerttemberg.de [95.208.2.43]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0LpDlp-1UEjHw1OLd-00f7cl; Sat, 01 Jun 2013 00:23:05 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org Subject: [PATCH 15/15] OF: remove #ifdef from linux/of_platform.h Date: Sat, 1 Jun 2013 00:22:52 +0200 Message-Id: <1370038972-2318779-16-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1370038972-2318779-1-git-send-email-arnd@arndb.de> References: <1370038972-2318779-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:BMgRbDgHvZyWEy8kwmZPY5uQ16bc9h5haAe1BmBYM0s A5RD7EtxNKqn/yM/gdnWCG9V3PI16jjgiwoP28iaE+giG2LfKP X/P8cVRk6ITTJaUqnCaYIhUijAREFki3whHvnrx4+H6QGL/hcQ 182uczeBinzZl1IH5fkvcdpIyvJykLUtsJf+RXlTU/Xj6clrUH 2c8seBpwWZ4JlJnEoWXYeYDNgHypKDf44sMWLxrse4uCBJEuRy vR8kHTlaXUMDYJIk7HkDySy8h+bOOElV2wVofeZINkAghO3Z1S FlT5hHy3feQOLGm5DEPxfmkY3H2aYbjniRGG6tGkRfUC7nxrBG XIAW5Wh7CTahBRVniHPgk2fcjft3uPzaNabFc0kdz X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130531_182331_617843_A0901180 X-CRM114-Status: GOOD ( 12.01 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.8 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Grant Likely , patches@lists.linaro.org, Rob Herring , Arnd Bergmann , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org A lot of code uses the functions from of_platform.h when built for devicetree-enabled platforms but can also be built without them. In order to avoid using #ifdef everywhere in drivers, this makes all the function declarations visible, which means we can use "if (IS_ENABLED(CONFIG_OF))" in driver code and get build coverage over the code but let the compiler drop the reference in the object code. Signed-off-by: Arnd Bergmann Cc: Grant Likely Cc: Rob Herring --- include/linux/of_platform.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 2a93b64..7747ad0 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -13,8 +13,6 @@ #include #include - -#ifdef CONFIG_OF_DEVICE #include #include #include @@ -82,7 +80,6 @@ extern struct platform_device *of_device_alloc(struct device_node *np, struct device *parent); extern struct platform_device *of_find_device_by_node(struct device_node *np); -#ifdef CONFIG_OF_ADDRESS /* device reg helpers depend on OF_ADDRESS */ /* Platform devices and busses creation */ extern struct platform_device *of_platform_device_create(struct device_node *np, const char *bus_id, @@ -91,17 +88,12 @@ extern struct platform_device *of_platform_device_create(struct device_node *np, extern int of_platform_bus_probe(struct device_node *root, const struct of_device_id *matches, struct device *parent); +#ifdef CONFIG_OF_ADDRESS extern int of_platform_populate(struct device_node *root, const struct of_device_id *matches, const struct of_dev_auxdata *lookup, struct device *parent); -#endif /* CONFIG_OF_ADDRESS */ - -#endif /* CONFIG_OF_DEVICE */ - -#if !defined(CONFIG_OF_ADDRESS) -struct of_dev_auxdata; -struct device_node; +#else static inline int of_platform_populate(struct device_node *root, const struct of_device_id *matches, const struct of_dev_auxdata *lookup, @@ -109,6 +101,6 @@ static inline int of_platform_populate(struct device_node *root, { return -ENODEV; } -#endif /* !CONFIG_OF_ADDRESS */ +#endif #endif /* _LINUX_OF_PLATFORM_H */