1
0
Fork 0

ACPI / hotplug: Use kobject_init_and_add() instead of _init() and _add()

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>
hifive-unleashed-5.1
Bjorn Helgaas 2013-09-25 14:23:20 -06:00 committed by Rafael J. Wysocki
parent cae7127241
commit acd3e2c994
1 changed files with 2 additions and 3 deletions

View 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;