ACPI / hotplug: Set kobject name via kobject_add(), not kobject_set_name()
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 25 Sep 2013 20:23:04 +0000 (14:23 -0600)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 30 Sep 2013 17:58:18 +0000 (19:58 +0200)
Set the kobject name via kobject_add() instead of using kobject_set_name(),
which is deprecated per Documentation/kobject.txt.

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

index 05306a59aedc18b45dd89f636d907def41d67d11..ea685835b8343b55ef23a4ae7dbc764656b50507 100644 (file)
@@ -763,12 +763,9 @@ void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug,
                goto err_out;
 
        kobject_init(&hotplug->kobj, &acpi_hotplug_profile_ktype);
-       error = kobject_set_name(&hotplug->kobj, "%s", name);
-       if (error)
-               goto err_out;
 
        hotplug->kobj.parent = hotplug_kobj;
-       error = kobject_add(&hotplug->kobj, hotplug_kobj, NULL);
+       error = kobject_add(&hotplug->kobj, hotplug_kobj, "%s", name);
        if (error)
                goto err_out;