diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-16 12:11:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:10 -0500 |
commit | 3514faca19a6fdc209734431c509631ea92b094e (patch) | |
tree | f6d102e6dec276f8e8d1044b47c74a02b901554f /drivers/pci/hotplug | |
parent | c11c4154e7ff4cebfadad849b1e22689d759c3f4 (diff) |
kobject: remove struct kobj_type from struct kset
We don't need a "default" ktype for a kset. We should set this
explicitly every time for each kset. This change is needed so that we
can make ksets dynamic, and cleans up one of the odd, undocumented
assumption that the kset/kobject/ktype model has.
This patch is based on a lot of help from Kay Sievers.
Nasty bug in the block code was found by Dave Young
<hidave.darkstar@gmail.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r-- | drivers/pci/hotplug/pci_hotplug_core.c | 7 | ||||
-rw-r--r-- | drivers/pci/hotplug/rpadlpar_sysfs.c | 1 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index 01c351c176ac..ce1cff0fdeca 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c | |||
@@ -96,7 +96,7 @@ static struct kobj_type hotplug_slot_ktype = { | |||
96 | .release = &hotplug_slot_release, | 96 | .release = &hotplug_slot_release, |
97 | }; | 97 | }; |
98 | 98 | ||
99 | decl_subsys_name(pci_hotplug_slots, slots, &hotplug_slot_ktype, NULL); | 99 | decl_subsys_name(pci_hotplug_slots, slots, NULL); |
100 | 100 | ||
101 | /* these strings match up with the values in pci_bus_speed */ | 101 | /* these strings match up with the values in pci_bus_speed */ |
102 | static char *pci_bus_speed_strings[] = { | 102 | static char *pci_bus_speed_strings[] = { |
@@ -633,7 +633,8 @@ int pci_hp_register (struct hotplug_slot *slot) | |||
633 | } | 633 | } |
634 | 634 | ||
635 | kobject_set_name(&slot->kobj, "%s", slot->name); | 635 | kobject_set_name(&slot->kobj, "%s", slot->name); |
636 | kobj_set_kset_s(slot, pci_hotplug_slots_subsys); | 636 | slot->kobj.kset = &pci_hotplug_slots_subsys; |
637 | slot->kobj.ktype = &hotplug_slot_ktype; | ||
637 | 638 | ||
638 | /* this can fail if we have already registered a slot with the same name */ | 639 | /* this can fail if we have already registered a slot with the same name */ |
639 | if (kobject_register(&slot->kobj)) { | 640 | if (kobject_register(&slot->kobj)) { |
@@ -701,7 +702,7 @@ static int __init pci_hotplug_init (void) | |||
701 | { | 702 | { |
702 | int result; | 703 | int result; |
703 | 704 | ||
704 | kobj_set_kset_s(&pci_hotplug_slots_subsys, pci_bus_type.subsys); | 705 | pci_hotplug_slots_subsys.kobj.kset = &pci_bus_type.subsys; |
705 | result = subsystem_register(&pci_hotplug_slots_subsys); | 706 | result = subsystem_register(&pci_hotplug_slots_subsys); |
706 | if (result) { | 707 | if (result) { |
707 | err("Register subsys with error %d\n", result); | 708 | err("Register subsys with error %d\n", result); |
diff --git a/drivers/pci/hotplug/rpadlpar_sysfs.c b/drivers/pci/hotplug/rpadlpar_sysfs.c index a080fedf0332..76090937c758 100644 --- a/drivers/pci/hotplug/rpadlpar_sysfs.c +++ b/drivers/pci/hotplug/rpadlpar_sysfs.c | |||
@@ -131,7 +131,6 @@ struct kobj_type ktype_dlpar_io = { | |||
131 | struct kset dlpar_io_kset = { | 131 | struct kset dlpar_io_kset = { |
132 | .kobj = {.ktype = &ktype_dlpar_io, | 132 | .kobj = {.ktype = &ktype_dlpar_io, |
133 | .parent = &pci_hotplug_slots_subsys.kobj}, | 133 | .parent = &pci_hotplug_slots_subsys.kobj}, |
134 | .ktype = &ktype_dlpar_io, | ||
135 | }; | 134 | }; |
136 | 135 | ||
137 | int dlpar_sysfs_init(void) | 136 | int dlpar_sysfs_init(void) |