From b4028437876866aba4747a655ede00f892089e14 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 11 May 2009 14:16:57 -0700 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/base/base.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/base/base.h') diff --git a/drivers/base/base.h b/drivers/base/base.h index 1e52c125f43..503d59c5750 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h @@ -70,6 +70,8 @@ struct class_private { * @knode_parent - node in sibling list * @knode_driver - node in driver list * @knode_bus - node in bus list + * @driver_data - private pointer for driver specific info. Will turn into a + * list soon. * @device - pointer back to the struct class that this structure is * associated with. * @@ -80,6 +82,7 @@ struct device_private { struct klist_node knode_parent; struct klist_node knode_driver; struct klist_node knode_bus; + void *driver_data; struct device *device; }; #define to_device_private_parent(obj) \ @@ -89,6 +92,8 @@ struct device_private { #define to_device_private_bus(obj) \ container_of(obj, struct device_private, knode_bus) +extern int device_private_init(struct device *dev); + /* initialisation functions */ extern int devices_init(void); extern int buses_init(void); -- cgit v1.2.3