diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/pci_hotplug_core.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index 175e0c8599e3..0f05e6a68b3b 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c | |||
@@ -630,19 +630,19 @@ int pci_hp_register (struct hotplug_slot *slot) | |||
630 | return -EINVAL; | 630 | return -EINVAL; |
631 | } | 631 | } |
632 | 632 | ||
633 | kobject_set_name(&slot->kobj, "%s", slot->name); | ||
634 | slot->kobj.kset = pci_hotplug_slots_kset; | ||
635 | slot->kobj.ktype = &hotplug_slot_ktype; | ||
636 | |||
637 | /* this can fail if we have already registered a slot with the same name */ | 633 | /* this can fail if we have already registered a slot with the same name */ |
638 | if (kobject_register(&slot->kobj)) { | 634 | slot->kobj.kset = pci_hotplug_slots_kset; |
639 | err("Unable to register kobject"); | 635 | result = kobject_init_and_add(&slot->kobj, &hotplug_slot_ktype, NULL, |
636 | "%s", slot->name); | ||
637 | if (result) { | ||
638 | err("Unable to register kobject '%s'", slot->name); | ||
640 | return -EINVAL; | 639 | return -EINVAL; |
641 | } | 640 | } |
642 | 641 | ||
643 | list_add (&slot->slot_list, &pci_hotplug_slot_list); | 642 | list_add (&slot->slot_list, &pci_hotplug_slot_list); |
644 | 643 | ||
645 | result = fs_add_slot (slot); | 644 | result = fs_add_slot (slot); |
645 | kobject_uevent(&slot->kobj, KOBJ_ADD); | ||
646 | dbg ("Added slot %s to the list\n", slot->name); | 646 | dbg ("Added slot %s to the list\n", slot->name); |
647 | return result; | 647 | return result; |
648 | } | 648 | } |