aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-04-13 16:15:19 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-05-02 21:57:59 -0400
commit823bccfc4002296ba88c3ad0f049e1abd8108d30 (patch)
tree5338ae0b32409446af4cd00c5107d9405d5bf0b6 /include/linux
parent2609e7b9bebfd433254c02538ba803dc516ff674 (diff)
remove "struct subsystem" as it is no longer needed
We need to work on cleaning up the relationship between kobjects, ksets and ktypes. The removal of 'struct subsystem' is the first step of this, especially as it is not really needed at all. Thanks to Kay for fixing the bugs in this patch. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/device.h8
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/kobject.h58
-rw-r--r--include/linux/module.h2
-rw-r--r--include/linux/pci_hotplug.h2
5 files changed, 32 insertions, 40 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index a0cd2ced31a9..ee292fe87cb2 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -53,7 +53,7 @@ struct bus_type {
53 const char * name; 53 const char * name;
54 struct module * owner; 54 struct module * owner;
55 55
56 struct subsystem subsys; 56 struct kset subsys;
57 struct kset drivers; 57 struct kset drivers;
58 struct kset devices; 58 struct kset devices;
59 struct klist klist_devices; 59 struct klist klist_devices;
@@ -179,7 +179,7 @@ struct class {
179 const char * name; 179 const char * name;
180 struct module * owner; 180 struct module * owner;
181 181
182 struct subsystem subsys; 182 struct kset subsys;
183 struct list_head children; 183 struct list_head children;
184 struct list_head devices; 184 struct list_head devices;
185 struct list_head interfaces; 185 struct list_head interfaces;
@@ -559,8 +559,8 @@ extern void device_shutdown(void);
559 559
560 560
561/* drivers/base/firmware.c */ 561/* drivers/base/firmware.c */
562extern int __must_check firmware_register(struct subsystem *); 562extern int __must_check firmware_register(struct kset *);
563extern void firmware_unregister(struct subsystem *); 563extern void firmware_unregister(struct kset *);
564 564
565/* debugging and troubleshooting/diagnostic helpers. */ 565/* debugging and troubleshooting/diagnostic helpers. */
566extern const char *dev_driver_string(struct device *dev); 566extern const char *dev_driver_string(struct device *dev);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 095a9c9a64fb..7c0077f06e24 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1416,7 +1416,7 @@ extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
1416extern int vfs_statfs(struct dentry *, struct kstatfs *); 1416extern int vfs_statfs(struct dentry *, struct kstatfs *);
1417 1417
1418/* /sys/fs */ 1418/* /sys/fs */
1419extern struct subsystem fs_subsys; 1419extern struct kset fs_subsys;
1420 1420
1421#define FLOCK_VERIFY_READ 1 1421#define FLOCK_VERIFY_READ 1
1422#define FLOCK_VERIFY_WRITE 2 1422#define FLOCK_VERIFY_WRITE 2
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index eb0e63ef297f..c288e41ba331 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -124,7 +124,6 @@ struct kset_uevent_ops {
124}; 124};
125 125
126struct kset { 126struct kset {
127 struct subsystem * subsys;
128 struct kobj_type * ktype; 127 struct kobj_type * ktype;
129 struct list_head list; 128 struct list_head list;
130 spinlock_t list_lock; 129 spinlock_t list_lock;
@@ -171,32 +170,23 @@ extern struct kobject * kset_find_obj(struct kset *, const char *);
171#define set_kset_name(str) .kset = { .kobj = { .name = str } } 170#define set_kset_name(str) .kset = { .kobj = { .name = str } }
172 171
173 172
174
175struct subsystem {
176 struct kset kset;
177};
178
179#define decl_subsys(_name,_type,_uevent_ops) \ 173#define decl_subsys(_name,_type,_uevent_ops) \
180struct subsystem _name##_subsys = { \ 174struct kset _name##_subsys = { \
181 .kset = { \ 175 .kobj = { .name = __stringify(_name) }, \
182 .kobj = { .name = __stringify(_name) }, \ 176 .ktype = _type, \
183 .ktype = _type, \ 177 .uevent_ops =_uevent_ops, \
184 .uevent_ops =_uevent_ops, \
185 } \
186} 178}
187#define decl_subsys_name(_varname,_name,_type,_uevent_ops) \ 179#define decl_subsys_name(_varname,_name,_type,_uevent_ops) \
188struct subsystem _varname##_subsys = { \ 180struct kset _varname##_subsys = { \
189 .kset = { \ 181 .kobj = { .name = __stringify(_name) }, \
190 .kobj = { .name = __stringify(_name) }, \ 182 .ktype = _type, \
191 .ktype = _type, \ 183 .uevent_ops =_uevent_ops, \
192 .uevent_ops =_uevent_ops, \
193 } \
194} 184}
195 185
196/* The global /sys/kernel/ subsystem for people to chain off of */ 186/* The global /sys/kernel/ subsystem for people to chain off of */
197extern struct subsystem kernel_subsys; 187extern struct kset kernel_subsys;
198/* The global /sys/hypervisor/ subsystem */ 188/* The global /sys/hypervisor/ subsystem */
199extern struct subsystem hypervisor_subsys; 189extern struct kset hypervisor_subsys;
200 190
201/** 191/**
202 * Helpers for setting the kset of registered objects. 192 * Helpers for setting the kset of registered objects.
@@ -214,7 +204,7 @@ extern struct subsystem hypervisor_subsys;
214 */ 204 */
215 205
216#define kobj_set_kset_s(obj,subsys) \ 206#define kobj_set_kset_s(obj,subsys) \
217 (obj)->kobj.kset = &(subsys).kset 207 (obj)->kobj.kset = &(subsys)
218 208
219/** 209/**
220 * kset_set_kset_s(obj,subsys) - set kset for embedded kset. 210 * kset_set_kset_s(obj,subsys) - set kset for embedded kset.
@@ -228,7 +218,7 @@ extern struct subsystem hypervisor_subsys;
228 */ 218 */
229 219
230#define kset_set_kset_s(obj,subsys) \ 220#define kset_set_kset_s(obj,subsys) \
231 (obj)->kset.kobj.kset = &(subsys).kset 221 (obj)->kset.kobj.kset = &(subsys)
232 222
233/** 223/**
234 * subsys_set_kset(obj,subsys) - set kset for subsystem 224 * subsys_set_kset(obj,subsys) - set kset for subsystem
@@ -241,29 +231,31 @@ extern struct subsystem hypervisor_subsys;
241 */ 231 */
242 232
243#define subsys_set_kset(obj,_subsys) \ 233#define subsys_set_kset(obj,_subsys) \
244 (obj)->subsys.kset.kobj.kset = &(_subsys).kset 234 (obj)->subsys.kobj.kset = &(_subsys)
245 235
246extern void subsystem_init(struct subsystem *); 236extern void subsystem_init(struct kset *);
247extern int __must_check subsystem_register(struct subsystem *); 237extern int __must_check subsystem_register(struct kset *);
248extern void subsystem_unregister(struct subsystem *); 238extern void subsystem_unregister(struct kset *);
249 239
250static inline struct subsystem * subsys_get(struct subsystem * s) 240static inline struct kset *subsys_get(struct kset *s)
251{ 241{
252 return s ? container_of(kset_get(&s->kset),struct subsystem,kset) : NULL; 242 if (s)
243 return kset_get(s);
244 return NULL;
253} 245}
254 246
255static inline void subsys_put(struct subsystem * s) 247static inline void subsys_put(struct kset *s)
256{ 248{
257 kset_put(&s->kset); 249 kset_put(s);
258} 250}
259 251
260struct subsys_attribute { 252struct subsys_attribute {
261 struct attribute attr; 253 struct attribute attr;
262 ssize_t (*show)(struct subsystem *, char *); 254 ssize_t (*show)(struct kset *, char *);
263 ssize_t (*store)(struct subsystem *, const char *, size_t); 255 ssize_t (*store)(struct kset *, const char *, size_t);
264}; 256};
265 257
266extern int __must_check subsys_create_file(struct subsystem * , 258extern int __must_check subsys_create_file(struct kset *,
267 struct subsys_attribute *); 259 struct subsys_attribute *);
268 260
269#if defined(CONFIG_HOTPLUG) 261#if defined(CONFIG_HOTPLUG)
diff --git a/include/linux/module.h b/include/linux/module.h
index 95679eb8571e..f0b0faf42d5d 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -568,7 +568,7 @@ struct device_driver;
568#ifdef CONFIG_SYSFS 568#ifdef CONFIG_SYSFS
569struct module; 569struct module;
570 570
571extern struct subsystem module_subsys; 571extern struct kset module_subsys;
572 572
573int mod_sysfs_init(struct module *mod); 573int mod_sysfs_init(struct module *mod);
574int mod_sysfs_setup(struct module *mod, 574int mod_sysfs_setup(struct module *mod,
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index a675a05c4091..ab4cb6ecd47c 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -174,7 +174,7 @@ extern int pci_hp_register (struct hotplug_slot *slot);
174extern int pci_hp_deregister (struct hotplug_slot *slot); 174extern int pci_hp_deregister (struct hotplug_slot *slot);
175extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, 175extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot,
176 struct hotplug_slot_info *info); 176 struct hotplug_slot_info *info);
177extern struct subsystem pci_hotplug_slots_subsys; 177extern struct kset pci_hotplug_slots_subsys;
178 178
179/* PCI Setting Record (Type 0) */ 179/* PCI Setting Record (Type 0) */
180struct hpp_type0 { 180struct hpp_type0 {