Skip to content

Commit

Permalink
ACPI: battery: Drop redundant test for failure
Browse files Browse the repository at this point in the history
Merging the two adjacent conditionally built blocks makes the code
a lot more readable.  And as a bonus, we drop a duplicate test when
CONFIG_ACPI_PROCFS_POWER is undefined.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Bjørn Mork authored and Rafael J. Wysocki committed Dec 13, 2017
1 parent 50c4c4e commit 6993ce4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,13 +1237,11 @@ static int acpi_battery_add(struct acpi_device *device)

#ifdef CONFIG_ACPI_PROCFS_POWER
result = acpi_battery_add_fs(device);
#endif
if (result) {
#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_battery_remove_fs(device);
#endif
goto fail;
}
#endif

printk(KERN_INFO PREFIX "%s Slot [%s] (battery %s)\n",
ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device),
Expand Down

0 comments on commit 6993ce4

Please sign in to comment.