diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-28 22:24:12 (GMT) |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-28 22:24:12 (GMT) |
commit | d00ab2fdd4dc4361c97777bc1fef7234329d4659 (patch) | |
tree | b8d8f98c1af633bbc1570b4270b39727737beebf /drivers/base/base.h | |
parent | 88f502fedba82eff252b6420e8b8328e4ae25c67 (diff) | |
parent | 7c730ccdc1188b97f5c8cb690906242c7ed75c22 (diff) | |
download | linux-d00ab2fdd4dc4361c97777bc1fef7234329d4659.tar.xz |
Merge branch 'linus' into core/futexes
Diffstat (limited to 'drivers/base/base.h')
-rw-r--r-- | drivers/base/base.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h index 9f50f1b..ddc9749 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h @@ -63,6 +63,32 @@ struct class_private { #define to_class(obj) \ container_of(obj, struct class_private, class_subsys.kobj) +/** + * struct device_private - structure to hold the private to the driver core portions of the device structure. + * + * @klist_children - klist containing all children of this device + * @knode_parent - node in sibling list + * @knode_driver - node in driver list + * @knode_bus - node in bus list + * @device - pointer back to the struct class that this structure is + * associated with. + * + * Nothing outside of the driver core should ever touch these fields. + */ +struct device_private { + struct klist klist_children; + struct klist_node knode_parent; + struct klist_node knode_driver; + struct klist_node knode_bus; + struct device *device; +}; +#define to_device_private_parent(obj) \ + container_of(obj, struct device_private, knode_parent) +#define to_device_private_driver(obj) \ + container_of(obj, struct device_private, knode_driver) +#define to_device_private_bus(obj) \ + container_of(obj, struct device_private, knode_bus) + /* initialisation functions */ extern int devices_init(void); extern int buses_init(void); @@ -86,6 +112,11 @@ extern void bus_remove_driver(struct device_driver *drv); extern void driver_detach(struct device_driver *drv); extern int driver_probe_device(struct device_driver *drv, struct device *dev); +static inline int driver_match_device(struct device_driver *drv, + struct device *dev) +{ + return drv->bus->match && drv->bus->match(dev, drv); +} extern void sysdev_shutdown(void); |