diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-28 18:05:50 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-28 18:05:50 -0400 |
commit | b0d44c0dbbd52effb731b1c0af9afd56215c48de (patch) | |
tree | 3237c0087d91a5390aed05689b9f610ba16fa116 /drivers/base/base.h | |
parent | 9537a48ed4b9e4b738943d6da0a0fd4278adf905 (diff) | |
parent | 7c730ccdc1188b97f5c8cb690906242c7ed75c22 (diff) |
Merge branch 'linus' into core/iommu
Conflicts:
arch/x86/Kconfig
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 9f50f1b545dc..ddc97496db4a 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h | |||
@@ -63,6 +63,32 @@ struct class_private { | |||
63 | #define to_class(obj) \ | 63 | #define to_class(obj) \ |
64 | container_of(obj, struct class_private, class_subsys.kobj) | 64 | container_of(obj, struct class_private, class_subsys.kobj) |
65 | 65 | ||
66 | /** | ||
67 | * struct device_private - structure to hold the private to the driver core portions of the device structure. | ||
68 | * | ||
69 | * @klist_children - klist containing all children of this device | ||
70 | * @knode_parent - node in sibling list | ||
71 | * @knode_driver - node in driver list | ||
72 | * @knode_bus - node in bus list | ||
73 | * @device - pointer back to the struct class that this structure is | ||
74 | * associated with. | ||
75 | * | ||
76 | * Nothing outside of the driver core should ever touch these fields. | ||
77 | */ | ||
78 | struct device_private { | ||
79 | struct klist klist_children; | ||
80 | struct klist_node knode_parent; | ||
81 | struct klist_node knode_driver; | ||
82 | struct klist_node knode_bus; | ||
83 | struct device *device; | ||
84 | }; | ||
85 | #define to_device_private_parent(obj) \ | ||
86 | container_of(obj, struct device_private, knode_parent) | ||
87 | #define to_device_private_driver(obj) \ | ||
88 | container_of(obj, struct device_private, knode_driver) | ||
89 | #define to_device_private_bus(obj) \ | ||
90 | container_of(obj, struct device_private, knode_bus) | ||
91 | |||
66 | /* initialisation functions */ | 92 | /* initialisation functions */ |
67 | extern int devices_init(void); | 93 | extern int devices_init(void); |
68 | extern int buses_init(void); | 94 | extern int buses_init(void); |
@@ -86,6 +112,11 @@ extern void bus_remove_driver(struct device_driver *drv); | |||
86 | 112 | ||
87 | extern void driver_detach(struct device_driver *drv); | 113 | extern void driver_detach(struct device_driver *drv); |
88 | extern int driver_probe_device(struct device_driver *drv, struct device *dev); | 114 | extern int driver_probe_device(struct device_driver *drv, struct device *dev); |
115 | static inline int driver_match_device(struct device_driver *drv, | ||
116 | struct device *dev) | ||
117 | { | ||
118 | return drv->bus->match && drv->bus->match(dev, drv); | ||
119 | } | ||
89 | 120 | ||
90 | extern void sysdev_shutdown(void); | 121 | extern void sysdev_shutdown(void); |
91 | 122 | ||