aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/of_device.h6
-rw-r--r--include/linux/of_platform.h35
-rw-r--r--include/linux/platform_device.h3
3 files changed, 9 insertions, 35 deletions
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 901b7435e890..9d27475feec1 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -4,12 +4,12 @@
4#include <linux/platform_device.h> 4#include <linux/platform_device.h>
5#include <linux/of_platform.h> /* temporary until merge */ 5#include <linux/of_platform.h> /* temporary until merge */
6 6
7#ifdef CONFIG_OF_DEVICE
8#include <linux/of.h> 7#include <linux/of.h>
9#include <linux/mod_devicetable.h> 8#include <linux/mod_devicetable.h>
10 9
11struct device; 10struct device;
12 11
12#ifdef CONFIG_OF
13extern const struct of_device_id *of_match_device( 13extern const struct of_device_id *of_match_device(
14 const struct of_device_id *matches, const struct device *dev); 14 const struct of_device_id *matches, const struct device *dev);
15extern void of_device_make_bus_id(struct device *dev); 15extern void of_device_make_bus_id(struct device *dev);
@@ -43,7 +43,7 @@ static inline void of_device_node_put(struct device *dev)
43 of_node_put(dev->of_node); 43 of_node_put(dev->of_node);
44} 44}
45 45
46#else /* CONFIG_OF_DEVICE */ 46#else /* CONFIG_OF */
47 47
48static inline int of_driver_match_device(struct device *dev, 48static inline int of_driver_match_device(struct device *dev,
49 struct device_driver *drv) 49 struct device_driver *drv)
@@ -67,6 +67,6 @@ static inline const struct of_device_id *of_match_device(
67{ 67{
68 return NULL; 68 return NULL;
69} 69}
70#endif /* CONFIG_OF_DEVICE */ 70#endif /* CONFIG_OF */
71 71
72#endif /* _LINUX_OF_DEVICE_H */ 72#endif /* _LINUX_OF_DEVICE_H */
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 2a93b64a3869..05cb4a928252 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>
@@ -53,27 +51,6 @@ struct of_dev_auxdata {
53 { .compatible = _compat, .phys_addr = _phys, .name = _name, \ 51 { .compatible = _compat, .phys_addr = _phys, .name = _name, \
54 .platform_data = _pdata } 52 .platform_data = _pdata }
55 53
56/**
57 * of_platform_driver - Legacy of-aware driver for platform devices.
58 *
59 * An of_platform_driver driver is attached to a basic platform_device on
60 * the ibm ebus (ibmebus_bus_type).
61 */
62struct of_platform_driver
63{
64 int (*probe)(struct platform_device* dev,
65 const struct of_device_id *match);
66 int (*remove)(struct platform_device* dev);
67
68 int (*suspend)(struct platform_device* dev, pm_message_t state);
69 int (*resume)(struct platform_device* dev);
70 int (*shutdown)(struct platform_device* dev);
71
72 struct device_driver driver;
73};
74#define to_of_platform_driver(drv) \
75 container_of(drv,struct of_platform_driver, driver)
76
77extern const struct of_device_id of_default_bus_match_table[]; 54extern const struct of_device_id of_default_bus_match_table[];
78 55
79/* Platform drivers register/unregister */ 56/* Platform drivers register/unregister */
@@ -82,7 +59,6 @@ extern struct platform_device *of_device_alloc(struct device_node *np,
82 struct device *parent); 59 struct device *parent);
83extern struct platform_device *of_find_device_by_node(struct device_node *np); 60extern struct platform_device *of_find_device_by_node(struct device_node *np);
84 61
85#ifdef CONFIG_OF_ADDRESS /* device reg helpers depend on OF_ADDRESS */
86/* Platform devices and busses creation */ 62/* Platform devices and busses creation */
87extern struct platform_device *of_platform_device_create(struct device_node *np, 63extern struct platform_device *of_platform_device_create(struct device_node *np,
88 const char *bus_id, 64 const char *bus_id,
@@ -91,17 +67,12 @@ extern struct platform_device *of_platform_device_create(struct device_node *np,
91extern int of_platform_bus_probe(struct device_node *root, 67extern int of_platform_bus_probe(struct device_node *root,
92 const struct of_device_id *matches, 68 const struct of_device_id *matches,
93 struct device *parent); 69 struct device *parent);
70#ifdef CONFIG_OF_ADDRESS
94extern int of_platform_populate(struct device_node *root, 71extern int of_platform_populate(struct device_node *root,
95 const struct of_device_id *matches, 72 const struct of_device_id *matches,
96 const struct of_dev_auxdata *lookup, 73 const struct of_dev_auxdata *lookup,
97 struct device *parent); 74 struct device *parent);
98#endif /* CONFIG_OF_ADDRESS */ 75#else
99
100#endif /* CONFIG_OF_DEVICE */
101
102#if !defined(CONFIG_OF_ADDRESS)
103struct of_dev_auxdata;
104struct device_node;
105static inline int of_platform_populate(struct device_node *root, 76static inline int of_platform_populate(struct device_node *root,
106 const struct of_device_id *matches, 77 const struct of_device_id *matches,
107 const struct of_dev_auxdata *lookup, 78 const struct of_dev_auxdata *lookup,
@@ -109,6 +80,6 @@ static inline int of_platform_populate(struct device_node *root,
109{ 80{
110 return -ENODEV; 81 return -ENODEV;
111} 82}
112#endif /* !CONFIG_OF_ADDRESS */ 83#endif
113 84
114#endif /* _LINUX_OF_PLATFORM_H */ 85#endif /* _LINUX_OF_PLATFORM_H */
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index cd46ee58b9dc..ce8e4ffd78c7 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -180,6 +180,9 @@ struct platform_driver {
180 const struct platform_device_id *id_table; 180 const struct platform_device_id *id_table;
181}; 181};
182 182
183#define to_platform_driver(drv) (container_of((drv), struct platform_driver, \
184 driver))
185
183/* 186/*
184 * use a macro to avoid include chaining to get THIS_MODULE 187 * use a macro to avoid include chaining to get THIS_MODULE
185 */ 188 */