diff options
author | Arnd Bergmann <arnd@arndb.de> | 2013-05-31 18:22:52 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2013-06-12 05:23:17 -0400 |
commit | 8a46f4f7f95f2bece108998a2e1b87b58f99d590 (patch) | |
tree | 772e3515955983e0284be67dec9f88e7860148a4 /include/linux/of_platform.h | |
parent | 317ddd256b9c24b0d78fa8018f80f1e495481a10 (diff) |
of: remove #ifdef from linux/of_platform.h
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>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'include/linux/of_platform.h')
-rw-r--r-- | include/linux/of_platform.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 2a93b64a3869..7747ad0027ae 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h | |||
@@ -13,8 +13,6 @@ | |||
13 | 13 | ||
14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
15 | #include <linux/mod_devicetable.h> | 15 | #include <linux/mod_devicetable.h> |
16 | |||
17 | #ifdef CONFIG_OF_DEVICE | ||
18 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
19 | #include <linux/of_device.h> | 17 | #include <linux/of_device.h> |
20 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
@@ -82,7 +80,6 @@ extern struct platform_device *of_device_alloc(struct device_node *np, | |||
82 | struct device *parent); | 80 | struct device *parent); |
83 | extern struct platform_device *of_find_device_by_node(struct device_node *np); | 81 | extern struct platform_device *of_find_device_by_node(struct device_node *np); |
84 | 82 | ||
85 | #ifdef CONFIG_OF_ADDRESS /* device reg helpers depend on OF_ADDRESS */ | ||
86 | /* Platform devices and busses creation */ | 83 | /* Platform devices and busses creation */ |
87 | extern struct platform_device *of_platform_device_create(struct device_node *np, | 84 | extern struct platform_device *of_platform_device_create(struct device_node *np, |
88 | const char *bus_id, | 85 | const char *bus_id, |
@@ -91,17 +88,12 @@ extern struct platform_device *of_platform_device_create(struct device_node *np, | |||
91 | extern int of_platform_bus_probe(struct device_node *root, | 88 | extern int of_platform_bus_probe(struct device_node *root, |
92 | const struct of_device_id *matches, | 89 | const struct of_device_id *matches, |
93 | struct device *parent); | 90 | struct device *parent); |
91 | #ifdef CONFIG_OF_ADDRESS | ||
94 | extern int of_platform_populate(struct device_node *root, | 92 | extern int of_platform_populate(struct device_node *root, |
95 | const struct of_device_id *matches, | 93 | const struct of_device_id *matches, |
96 | const struct of_dev_auxdata *lookup, | 94 | const struct of_dev_auxdata *lookup, |
97 | struct device *parent); | 95 | struct device *parent); |
98 | #endif /* CONFIG_OF_ADDRESS */ | 96 | #else |
99 | |||
100 | #endif /* CONFIG_OF_DEVICE */ | ||
101 | |||
102 | #if !defined(CONFIG_OF_ADDRESS) | ||
103 | struct of_dev_auxdata; | ||
104 | struct device_node; | ||
105 | static inline int of_platform_populate(struct device_node *root, | 97 | static inline int of_platform_populate(struct device_node *root, |
106 | const struct of_device_id *matches, | 98 | const struct of_device_id *matches, |
107 | const struct of_dev_auxdata *lookup, | 99 | const struct of_dev_auxdata *lookup, |
@@ -109,6 +101,6 @@ static inline int of_platform_populate(struct device_node *root, | |||
109 | { | 101 | { |
110 | return -ENODEV; | 102 | return -ENODEV; |
111 | } | 103 | } |
112 | #endif /* !CONFIG_OF_ADDRESS */ | 104 | #endif |
113 | 105 | ||
114 | #endif /* _LINUX_OF_PLATFORM_H */ | 106 | #endif /* _LINUX_OF_PLATFORM_H */ |