diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-17 14:54:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:28 -0500 |
commit | 64dbcac3a16d0d22045b2c80d7f208196575486a (patch) | |
tree | fd716df9d29fb7cc4c8a78e7cfdcad623217065e | |
parent | 94f57f33680922197581b127b3badde7ef658258 (diff) |
Kobject: change drivers/pci/hotplug/pci_hotplug_core.c to use kobject_init_and_add
Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 | } |