Commit eb03cb02 authored by Stefan Hajnoczi's avatar Stefan Hajnoczi Committed by Len Brown

ACPI / Battery: propagate sysfs error in acpi_battery_add()

Make sure the error return from sysfs_add_battery() is checked and
propagated out from acpi_battery_add().
Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent e80bba4b
......@@ -630,8 +630,11 @@ static int acpi_battery_update(struct acpi_battery *battery)
return result;
acpi_battery_init_alarm(battery);
}
if (!battery->bat.dev)
sysfs_add_battery(battery);
if (!battery->bat.dev) {
result = sysfs_add_battery(battery);
if (result)
return result;
}
result = acpi_battery_get_state(battery);
acpi_battery_quirks(battery);
return result;
......@@ -982,7 +985,9 @@ static int acpi_battery_add(struct acpi_device *device)
if (ACPI_SUCCESS(acpi_get_handle(battery->device->handle,
"_BIX", &handle)))
set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags);
acpi_battery_update(battery);
result = acpi_battery_update(battery);
if (result)
goto fail;
#ifdef CONFIG_ACPI_PROCFS_POWER
result = acpi_battery_add_fs(device);
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment