ACPI / hotplug: Use kobject_init_and_add() instead of _init() and _add()
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 25 Sep 2013 20:23:20 +0000 (14:23 -0600)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 30 Sep 2013 17:58:18 +0000 (19:58 +0200)
Use kobject_init_and_add() since we have nothing special to do between
kobject_init() and kobject_add().

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/sysfs.c

index 75432819579cd2459320f8f34eabdb2eb31d1fcb..bb6045c5385bd181689b5f2c76779f7155493aff 100644 (file)
@@ -762,9 +762,8 @@ void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug,
        if (!hotplug_kobj)
                goto err_out;
 
-       kobject_init(&hotplug->kobj, &acpi_hotplug_profile_ktype);
-
-       error = kobject_add(&hotplug->kobj, hotplug_kobj, "%s", name);
+       error = kobject_init_and_add(&hotplug->kobj,
+               &acpi_hotplug_profile_ktype, hotplug_kobj, "%s", name);
        if (error)
                goto err_out;