Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=64dbcac3a16d0d22045b2c80d7f208196575486a
Commit:     64dbcac3a16d0d22045b2c80d7f208196575486a
Parent:     94f57f33680922197581b127b3badde7ef658258
Author:     Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 17 15:54:39 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jan 24 20:40:28 2008 -0800

    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 <[EMAIL PROTECTED]>
    Cc: Kay Sievers <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 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 175e0c8..0f05e6a 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)
                return -EINVAL;
        }
 
-       kobject_set_name(&slot->kobj, "%s", slot->name);
-       slot->kobj.kset = pci_hotplug_slots_kset;
-       slot->kobj.ktype = &hotplug_slot_ktype;
-
        /* this can fail if we have already registered a slot with the same 
name */
-       if (kobject_register(&slot->kobj)) {
-               err("Unable to register kobject");
+       slot->kobj.kset = pci_hotplug_slots_kset;
+       result = kobject_init_and_add(&slot->kobj, &hotplug_slot_ktype, NULL,
+                                     "%s", slot->name);
+       if (result) {
+               err("Unable to register kobject '%s'", slot->name);
                return -EINVAL;
        }
-               
+
        list_add (&slot->slot_list, &pci_hotplug_slot_list);
 
        result = fs_add_slot (slot);
+       kobject_uevent(&slot->kobj, KOBJ_ADD);
        dbg ("Added slot %s to the list\n", slot->name);
        return result;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to