Skip to content

Commit

Permalink
ACPI / hotplug: Use kobject_init_and_add() instead of _init() and _add()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bjorn Helgaas authored and Rafael J. Wysocki committed Sep 30, 2013
1 parent cae7127 commit acd3e2c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/acpi/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit acd3e2c

Please sign in to comment.