aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h1
-rw-r--r--include/linux/of.h2
-rw-r--r--include/linux/of_device.h5
-rw-r--r--include/linux/of_platform.h18
4 files changed, 6 insertions, 20 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index dba775a68752..144ec135875f 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -442,6 +442,7 @@ struct device {
442 struct dev_archdata archdata; 442 struct dev_archdata archdata;
443 443
444 struct device_node *of_node; /* associated device tree node */ 444 struct device_node *of_node; /* associated device tree node */
445 const struct of_device_id *of_match; /* matching of_device_id from driver */
445 446
446 dev_t devt; /* dev_t, creates the sysfs "dev" */ 447 dev_t devt; /* dev_t, creates the sysfs "dev" */
447 448
diff --git a/include/linux/of.h b/include/linux/of.h
index 266db1d0baa9..bfc0ed1b0ced 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -108,7 +108,7 @@ extern void of_node_put(struct device_node *node);
108#endif 108#endif
109 109
110/* 110/*
111 * OF address retreival & translation 111 * OF address retrieval & translation
112 */ 112 */
113 113
114/* Helper to read a big number; size is in cells (not bytes) */ 114/* Helper to read a big number; size is in cells (not bytes) */
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 975d347079d9..8bfe6c1d4365 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -18,10 +18,11 @@ extern void of_device_make_bus_id(struct device *dev);
18 * @drv: the device_driver structure to test 18 * @drv: the device_driver structure to test
19 * @dev: the device structure to match against 19 * @dev: the device structure to match against
20 */ 20 */
21static inline int of_driver_match_device(const struct device *dev, 21static inline int of_driver_match_device(struct device *dev,
22 const struct device_driver *drv) 22 const struct device_driver *drv)
23{ 23{
24 return of_match_device(drv->of_match_table, dev) != NULL; 24 dev->of_match = of_match_device(drv->of_match_table, dev);
25 return dev->of_match != NULL;
25} 26}
26 27
27extern struct platform_device *of_dev_get(struct platform_device *dev); 28extern struct platform_device *of_dev_get(struct platform_device *dev);
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index a68716ad38ce..17c7e21c0bd7 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -23,13 +23,7 @@
23 * of_platform_driver - Legacy of-aware driver for platform devices. 23 * of_platform_driver - Legacy of-aware driver for platform devices.
24 * 24 *
25 * An of_platform_driver driver is attached to a basic platform_device on 25 * An of_platform_driver driver is attached to a basic platform_device on
26 * ether the "platform bus" (platform_bus_type), or the ibm ebus 26 * the ibm ebus (ibmebus_bus_type).
27 * (ibmebus_bus_type).
28 *
29 * of_platform_driver is being phased out when used with the platform_bus_type,
30 * and regular platform_drivers should be used instead. When the transition
31 * is complete, only ibmebus will be using this structure, and the
32 * platform_driver member of this structure will be removed.
33 */ 27 */
34struct of_platform_driver 28struct of_platform_driver
35{ 29{
@@ -42,26 +36,16 @@ struct of_platform_driver
42 int (*shutdown)(struct platform_device* dev); 36 int (*shutdown)(struct platform_device* dev);
43 37
44 struct device_driver driver; 38 struct device_driver driver;
45 struct platform_driver platform_driver;
46}; 39};
47#define to_of_platform_driver(drv) \ 40#define to_of_platform_driver(drv) \
48 container_of(drv,struct of_platform_driver, driver) 41 container_of(drv,struct of_platform_driver, driver)
49 42
50extern int of_register_driver(struct of_platform_driver *drv,
51 struct bus_type *bus);
52extern void of_unregister_driver(struct of_platform_driver *drv);
53
54/* Platform drivers register/unregister */ 43/* Platform drivers register/unregister */
55extern int of_register_platform_driver(struct of_platform_driver *drv);
56extern void of_unregister_platform_driver(struct of_platform_driver *drv);
57
58extern struct platform_device *of_device_alloc(struct device_node *np, 44extern struct platform_device *of_device_alloc(struct device_node *np,
59 const char *bus_id, 45 const char *bus_id,
60 struct device *parent); 46 struct device *parent);
61extern struct platform_device *of_find_device_by_node(struct device_node *np); 47extern struct platform_device *of_find_device_by_node(struct device_node *np);
62 48
63extern int of_bus_type_init(struct bus_type *bus, const char *name);
64
65#if !defined(CONFIG_SPARC) /* SPARC has its own device registration method */ 49#if !defined(CONFIG_SPARC) /* SPARC has its own device registration method */
66/* Platform devices and busses creation */ 50/* Platform devices and busses creation */
67extern struct platform_device *of_platform_device_create(struct device_node *np, 51extern struct platform_device *of_platform_device_create(struct device_node *np,