aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/base.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-05-11 17:16:57 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 12:50:47 -0400
commitb4028437876866aba4747a655ede00f892089e14 (patch)
treef6c34315c3e6d2899a894f028bd6f9899e80cd01 /drivers/base/base.h
parent2023c610dc54a4f4130b0494309a9bd668ca3df8 (diff)
Driver core: move dev_get/set_drvdata to drivers/base/dd.c
No one should directly access the driver_data field, so remove the field and make it private. We dynamically create the private field now if it is needed, to handle drivers that call get/set before they are registered with the driver core. Also update the copyright notices on these files while we are there. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/base.h')
-rw-r--r--drivers/base/base.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 1e52c125f437..503d59c57501 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -70,6 +70,8 @@ struct class_private {
70 * @knode_parent - node in sibling list 70 * @knode_parent - node in sibling list
71 * @knode_driver - node in driver list 71 * @knode_driver - node in driver list
72 * @knode_bus - node in bus list 72 * @knode_bus - node in bus list
73 * @driver_data - private pointer for driver specific info. Will turn into a
74 * list soon.
73 * @device - pointer back to the struct class that this structure is 75 * @device - pointer back to the struct class that this structure is
74 * associated with. 76 * associated with.
75 * 77 *
@@ -80,6 +82,7 @@ struct device_private {
80 struct klist_node knode_parent; 82 struct klist_node knode_parent;
81 struct klist_node knode_driver; 83 struct klist_node knode_driver;
82 struct klist_node knode_bus; 84 struct klist_node knode_bus;
85 void *driver_data;
83 struct device *device; 86 struct device *device;
84}; 87};
85#define to_device_private_parent(obj) \ 88#define to_device_private_parent(obj) \
@@ -89,6 +92,8 @@ struct device_private {
89#define to_device_private_bus(obj) \ 92#define to_device_private_bus(obj) \
90 container_of(obj, struct device_private, knode_bus) 93 container_of(obj, struct device_private, knode_bus)
91 94
95extern int device_private_init(struct device *dev);
96
92/* initialisation functions */ 97/* initialisation functions */
93extern int devices_init(void); 98extern int devices_init(void);
94extern int buses_init(void); 99extern int buses_init(void);