From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 15/15] OF: remove #ifdef from linux/of_platform.h
Date: Sat, 1 Jun 2013 09:01:07 -0500 [thread overview]
Message-ID: <CAL_Jsq+-7RizbVQSA-JnJRZFc9-3RFCXuCOXP=GfCin2Losfeg@mail.gmail.com> (raw)
In-Reply-To: <1370038972-2318779-16-git-send-email-arnd@arndb.de>
On Fri, May 31, 2013 at 5:22 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> 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 <arnd@arndb.de>
> Cc: Grant Likely <grant.likely@linaro.org>
> Cc: Rob Herring <rob.herring@calxeda.com>
I've got a more complete series for 3.11 that removes OF_DEVICE and
of_platform_driver completely. I'm waiting on ack from Ben H.
Rob
> ---
> 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 <linux/device.h>
> #include <linux/mod_devicetable.h>
> -
> -#ifdef CONFIG_OF_DEVICE
> #include <linux/pm.h>
> #include <linux/of_device.h>
> #include <linux/platform_device.h>
> @@ -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 */
> --
> 1.8.1.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2013-06-01 14:01 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-31 22:22 [PATCH 00/15] Linux-3.10 ARM randconfig fixes Arnd Bergmann
2013-05-31 22:22 ` [PATCH 01/15] irqdomain: export irq_domain_add_simple Arnd Bergmann
2013-05-31 22:22 ` [PATCH 02/15] mtd: omap2: allow bulding as a module Arnd Bergmann
2013-05-31 22:22 ` [PATCH 03/15] drm/nouveau: use mdelay instead of large udelay constants Arnd Bergmann
2013-05-31 23:34 ` Aaro Koskinen
2013-05-31 22:22 ` [PATCH 04/15] [SCSI] nsp32: " Arnd Bergmann
2013-05-31 22:22 ` [PATCH 05/15] hwrng: bcm2835: fix MODULE_LICENSE tag Arnd Bergmann
2013-06-21 7:16 ` Herbert Xu
2013-05-31 22:22 ` [PATCH 06/15] cpuidle: calxeda: select ARM_CPU_SUSPEND Arnd Bergmann
2013-05-31 22:22 ` [PATCH 07/15] cpufreq: spear needs cpufreq table Arnd Bergmann
2013-06-01 1:58 ` Viresh Kumar
2013-06-01 9:03 ` Arnd Bergmann
2013-06-01 9:45 ` Viresh Kumar
2013-06-01 2:17 ` Ezequiel Garcia
2013-06-02 20:42 ` Andrew Lunn
2013-05-31 22:22 ` [PATCH 08/15] thermal: cpu_cooling: fix stub function Arnd Bergmann
2013-06-19 17:25 ` Eduardo Valentin
2013-06-19 18:18 ` Arnd Bergmann
2013-05-31 22:22 ` [PATCH 09/15] drm: always provide debugfs function prototypes Arnd Bergmann
2013-05-31 22:22 ` [PATCH 10/15] drm/tilcd: select BACKLIGHT_LCD_SUPPORT Arnd Bergmann
2013-05-31 22:22 ` [PATCH 11/15] iwlegacy: il_pm_ops is only provided for PM_SLEEP Arnd Bergmann
2013-06-01 5:43 ` Brian Norris
2013-06-01 9:03 ` Arnd Bergmann
2013-06-01 9:12 ` [PATCH v2] " Arnd Bergmann
2013-05-31 22:22 ` [PATCH 12/15] [media] davinci: vpfe_capture needs i2c Arnd Bergmann
2013-05-31 22:22 ` [PATCH 13/15] [media] omap3isp: include linux/mm_types.h Arnd Bergmann
2013-06-01 15:30 ` Laurent Pinchart
2013-06-01 20:04 ` Arnd Bergmann
2013-05-31 22:22 ` [PATCH 14/15] clk: tegra: provide tegra_periph_reset_assert alternative Arnd Bergmann
2013-05-31 22:22 ` [PATCH 15/15] OF: remove #ifdef from linux/of_platform.h Arnd Bergmann
2013-06-01 14:01 ` Rob Herring [this message]
2013-06-01 20:03 ` Arnd Bergmann
2013-06-01 20:30 ` Rob Herring
2013-06-01 20:57 ` Arnd Bergmann
2013-06-04 13:01 ` Rob Herring
2013-06-04 17:51 ` Arnd Bergmann
2013-06-04 22:24 ` Rob Herring
2013-06-05 12:13 ` Arnd Bergmann
2013-06-05 21:48 ` Grant Likely
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='CAL_Jsq+-7RizbVQSA-JnJRZFc9-3RFCXuCOXP=GfCin2Losfeg@mail.gmail.com' \
--to=robherring2@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).