Skip to content

Commit

Permalink
of: protect contents of of_platform.h and of_device.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Grant Likely committed Apr 29, 2010
1 parent 8bfe9b5 commit efb2e01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/of_device.h
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -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 */
2 changes: 2 additions & 0 deletions include/linux/of_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
*/

#ifdef CONFIG_OF_DEVICE
#include <linux/module.h>
#include <linux/device.h>
#include <linux/mod_devicetable.h>
Expand Down Expand Up @@ -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 */

0 comments on commit efb2e01

Please sign in to comment.