diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-30 00:22:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:14 -0500 |
commit | 81ace5cd8fcb55e144f496af40d4275b03252456 (patch) | |
tree | 490271ade80924cb0181f71f1c52d7f3976afa76 /drivers/pci | |
parent | d405936b322220dc5cca9d2b58ef1911ae8efec9 (diff) |
kset: convert pci hotplug to use kset_create_and_add
This also renames pci_hotplug_slots_subsys to pcis_hotplug_slots_kset
catch all current users with a build error instead of a build warning
which can easily be missed.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/acpiphp_ibm.c | 4 | ||||
-rw-r--r-- | drivers/pci/hotplug/pci_hotplug_core.c | 23 | ||||
-rw-r--r-- | drivers/pci/hotplug/rpadlpar_sysfs.c | 2 |
3 files changed, 14 insertions, 15 deletions
diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c index 47d26b65e99..750ebd7a4c1 100644 --- a/drivers/pci/hotplug/acpiphp_ibm.c +++ b/drivers/pci/hotplug/acpiphp_ibm.c | |||
@@ -429,7 +429,7 @@ static int __init ibm_acpiphp_init(void) | |||
429 | int retval = 0; | 429 | int retval = 0; |
430 | acpi_status status; | 430 | acpi_status status; |
431 | struct acpi_device *device; | 431 | struct acpi_device *device; |
432 | struct kobject *sysdir = &pci_hotplug_slots_subsys.kobj; | 432 | struct kobject *sysdir = &pci_hotplug_slots_kset->kobj; |
433 | 433 | ||
434 | dbg("%s\n", __FUNCTION__); | 434 | dbg("%s\n", __FUNCTION__); |
435 | 435 | ||
@@ -476,7 +476,7 @@ init_return: | |||
476 | static void __exit ibm_acpiphp_exit(void) | 476 | static void __exit ibm_acpiphp_exit(void) |
477 | { | 477 | { |
478 | acpi_status status; | 478 | acpi_status status; |
479 | struct kobject *sysdir = &pci_hotplug_slots_subsys.kobj; | 479 | struct kobject *sysdir = &pci_hotplug_slots_kset->kobj; |
480 | 480 | ||
481 | dbg("%s\n", __FUNCTION__); | 481 | dbg("%s\n", __FUNCTION__); |
482 | 482 | ||
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index ce1cff0fdec..175e0c8599e 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c | |||
@@ -61,7 +61,7 @@ static int debug; | |||
61 | 61 | ||
62 | static LIST_HEAD(pci_hotplug_slot_list); | 62 | static LIST_HEAD(pci_hotplug_slot_list); |
63 | 63 | ||
64 | struct kset pci_hotplug_slots_subsys; | 64 | struct kset *pci_hotplug_slots_kset; |
65 | 65 | ||
66 | static ssize_t hotplug_slot_attr_show(struct kobject *kobj, | 66 | static ssize_t hotplug_slot_attr_show(struct kobject *kobj, |
67 | struct attribute *attr, char *buf) | 67 | struct attribute *attr, char *buf) |
@@ -96,8 +96,6 @@ 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, NULL); | ||
100 | |||
101 | /* these strings match up with the values in pci_bus_speed */ | 99 | /* these strings match up with the values in pci_bus_speed */ |
102 | static char *pci_bus_speed_strings[] = { | 100 | static char *pci_bus_speed_strings[] = { |
103 | "33 MHz PCI", /* 0x00 */ | 101 | "33 MHz PCI", /* 0x00 */ |
@@ -633,7 +631,7 @@ int pci_hp_register (struct hotplug_slot *slot) | |||
633 | } | 631 | } |
634 | 632 | ||
635 | kobject_set_name(&slot->kobj, "%s", slot->name); | 633 | kobject_set_name(&slot->kobj, "%s", slot->name); |
636 | slot->kobj.kset = &pci_hotplug_slots_subsys; | 634 | slot->kobj.kset = pci_hotplug_slots_kset; |
637 | slot->kobj.ktype = &hotplug_slot_ktype; | 635 | slot->kobj.ktype = &hotplug_slot_ktype; |
638 | 636 | ||
639 | /* this can fail if we have already registered a slot with the same name */ | 637 | /* this can fail if we have already registered a slot with the same name */ |
@@ -702,10 +700,11 @@ static int __init pci_hotplug_init (void) | |||
702 | { | 700 | { |
703 | int result; | 701 | int result; |
704 | 702 | ||
705 | pci_hotplug_slots_subsys.kobj.kset = &pci_bus_type.subsys; | 703 | pci_hotplug_slots_kset = kset_create_and_add("slots", NULL, |
706 | result = subsystem_register(&pci_hotplug_slots_subsys); | 704 | &pci_bus_type.subsys.kobj); |
707 | if (result) { | 705 | if (!pci_hotplug_slots_kset) { |
708 | err("Register subsys with error %d\n", result); | 706 | result = -ENOMEM; |
707 | err("Register subsys error\n"); | ||
709 | goto exit; | 708 | goto exit; |
710 | } | 709 | } |
711 | result = cpci_hotplug_init(debug); | 710 | result = cpci_hotplug_init(debug); |
@@ -716,9 +715,9 @@ static int __init pci_hotplug_init (void) | |||
716 | 715 | ||
717 | info (DRIVER_DESC " version: " DRIVER_VERSION "\n"); | 716 | info (DRIVER_DESC " version: " DRIVER_VERSION "\n"); |
718 | goto exit; | 717 | goto exit; |
719 | 718 | ||
720 | err_subsys: | 719 | err_subsys: |
721 | subsystem_unregister(&pci_hotplug_slots_subsys); | 720 | kset_unregister(pci_hotplug_slots_kset); |
722 | exit: | 721 | exit: |
723 | return result; | 722 | return result; |
724 | } | 723 | } |
@@ -726,7 +725,7 @@ exit: | |||
726 | static void __exit pci_hotplug_exit (void) | 725 | static void __exit pci_hotplug_exit (void) |
727 | { | 726 | { |
728 | cpci_hotplug_exit(); | 727 | cpci_hotplug_exit(); |
729 | subsystem_unregister(&pci_hotplug_slots_subsys); | 728 | kset_unregister(pci_hotplug_slots_kset); |
730 | } | 729 | } |
731 | 730 | ||
732 | module_init(pci_hotplug_init); | 731 | module_init(pci_hotplug_init); |
@@ -738,7 +737,7 @@ MODULE_LICENSE("GPL"); | |||
738 | module_param(debug, bool, 0644); | 737 | module_param(debug, bool, 0644); |
739 | MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); | 738 | MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); |
740 | 739 | ||
741 | EXPORT_SYMBOL_GPL(pci_hotplug_slots_subsys); | 740 | EXPORT_SYMBOL_GPL(pci_hotplug_slots_kset); |
742 | EXPORT_SYMBOL_GPL(pci_hp_register); | 741 | EXPORT_SYMBOL_GPL(pci_hp_register); |
743 | EXPORT_SYMBOL_GPL(pci_hp_deregister); | 742 | EXPORT_SYMBOL_GPL(pci_hp_deregister); |
744 | EXPORT_SYMBOL_GPL(pci_hp_change_slot_info); | 743 | EXPORT_SYMBOL_GPL(pci_hp_change_slot_info); |
diff --git a/drivers/pci/hotplug/rpadlpar_sysfs.c b/drivers/pci/hotplug/rpadlpar_sysfs.c index 76090937c75..5c3ddb60a00 100644 --- a/drivers/pci/hotplug/rpadlpar_sysfs.c +++ b/drivers/pci/hotplug/rpadlpar_sysfs.c | |||
@@ -130,7 +130,7 @@ struct kobj_type ktype_dlpar_io = { | |||
130 | 130 | ||
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_kset->kobj}, |
134 | }; | 134 | }; |
135 | 135 | ||
136 | int dlpar_sysfs_init(void) | 136 | int dlpar_sysfs_init(void) |