of: protect contents of of_platform.h and of_device.h
authorGrant Likely <grant.likely@secretlab.ca>
Tue, 13 Apr 2010 23:12:27 +0000 (16:12 -0700)
committerGrant Likely <grant.likely@secretlab.ca>
Thu, 29 Apr 2010 00:20:30 +0000 (18:20 -0600)
Only process contents of of_platform.h and of_device.h if
CONFIG_OF_DEVICE is set.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
include/linux/of_device.h
include/linux/of_platform.h

index d3a74e00a3e13455b7ad7f6eec81d58727e40386..e7904a9cd3a3d1ff1cfaa2e433b22db8014b2513 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _LINUX_OF_DEVICE_H
 #define _LINUX_OF_DEVICE_H
 
+#ifdef CONFIG_OF_DEVICE
 #include <linux/device.h>
 #include <linux/of.h>
 #include <linux/mod_devicetable.h>
@@ -26,5 +27,6 @@ static inline void of_device_free(struct of_device *dev)
 
 extern ssize_t of_device_get_modalias(struct of_device *ofdev,
                                        char *str, ssize_t len);
+#endif /* CONFIG_OF_DEVICE */
 
 #endif /* _LINUX_OF_DEVICE_H */
index 908406651330e700bbea64084599d023fa77cad7..ac3ae0758fbe44b723213e01ddcd9642cb8e98a0 100644 (file)
@@ -11,6 +11,7 @@
  *
  */
 
+#ifdef CONFIG_OF_DEVICE
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/mod_devicetable.h>
@@ -66,5 +67,6 @@ static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
 extern struct of_device *of_find_device_by_node(struct device_node *np);
 
 extern int of_bus_type_init(struct bus_type *bus, const char *name);
+#endif /* CONFIG_OF_DEVICE */
 
 #endif /* _LINUX_OF_PLATFORM_H */