diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-11-01 22:41:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:33 -0500 |
commit | c6f7e72a3f4641095ade9ded287d910c980c6148 (patch) | |
tree | d2d7d946b978ce9f5586a02c3520aa76e928a551 /drivers/base/base.h | |
parent | b249072ee6897fe4f8d461c7bb4b926223263c28 (diff) |
driver core: remove fields from struct bus_type
struct bus_type is static everywhere in the kernel. This moves the
kobject in the structure out of it, and a bunch of other private only to
the driver core fields are now moved to a private structure. This lets
us dynamically create the backing kobject properly and gives us the
chance to be able to document to users exactly how to use the struct
bus_type as there are no fields they can improperly access.
Thanks to Kay for the build fixes on this patch.
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.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h index 7e309a49a711..ca6d273064f8 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h | |||
@@ -1,6 +1,34 @@ | |||
1 | 1 | ||
2 | /* initialisation functions */ | 2 | /** |
3 | * struct bus_type_private - structure to hold the private to the driver core portions of the bus_type structure. | ||
4 | * | ||
5 | * @subsys - the struct kset that defines this bus. This is the main kobject | ||
6 | * @drivers_kset - the list of drivers associated with this bus | ||
7 | * @devices_kset - the list of devices associated with this bus | ||
8 | * @klist_devices - the klist to iterate over the @devices_kset | ||
9 | * @klist_drivers - the klist to iterate over the @drivers_kset | ||
10 | * @bus_notifier - the bus notifier list for anything that cares about things | ||
11 | * on this bus. | ||
12 | * @bus - pointer back to the struct bus_type that this structure is associated | ||
13 | * with. | ||
14 | * | ||
15 | * This structure is the one that is the actual kobject allowing struct | ||
16 | * bus_type to be statically allocated safely. Nothing outside of the driver | ||
17 | * core should ever touch these fields. | ||
18 | */ | ||
19 | struct bus_type_private { | ||
20 | struct kset subsys; | ||
21 | struct kset *drivers_kset; | ||
22 | struct kset *devices_kset; | ||
23 | struct klist klist_devices; | ||
24 | struct klist klist_drivers; | ||
25 | struct blocking_notifier_head bus_notifier; | ||
26 | unsigned int drivers_autoprobe:1; | ||
27 | struct bus_type *bus; | ||
28 | }; | ||
29 | |||
3 | 30 | ||
31 | /* initialisation functions */ | ||
4 | extern int devices_init(void); | 32 | extern int devices_init(void); |
5 | extern int buses_init(void); | 33 | extern int buses_init(void); |
6 | extern int classes_init(void); | 34 | extern int classes_init(void); |