Commit efb2e014 authored by Grant Likely's avatar Grant Likely

of: protect contents of of_platform.h and of_device.h

Only process contents of of_platform.h and of_device.h if
CONFIG_OF_DEVICE is set.
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 8bfe9b5c
#ifndef _LINUX_OF_DEVICE_H #ifndef _LINUX_OF_DEVICE_H
#define _LINUX_OF_DEVICE_H #define _LINUX_OF_DEVICE_H
#ifdef CONFIG_OF_DEVICE
#include <linux/device.h> #include <linux/device.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
...@@ -26,5 +27,6 @@ static inline void of_device_free(struct of_device *dev) ...@@ -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, extern ssize_t of_device_get_modalias(struct of_device *ofdev,
char *str, ssize_t len); char *str, ssize_t len);
#endif /* CONFIG_OF_DEVICE */
#endif /* _LINUX_OF_DEVICE_H */ #endif /* _LINUX_OF_DEVICE_H */
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
* *
*/ */
#ifdef CONFIG_OF_DEVICE
#include <linux/module.h> #include <linux/module.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
...@@ -66,5 +67,6 @@ static inline void of_unregister_platform_driver(struct of_platform_driver *drv) ...@@ -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 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); extern int of_bus_type_init(struct bus_type *bus, const char *name);
#endif /* CONFIG_OF_DEVICE */
#endif /* _LINUX_OF_PLATFORM_H */ #endif /* _LINUX_OF_PLATFORM_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment