Skip to content

Commit 0d17aaf

Browse files
committed
ACPI: battery: Reduce code duplication related to cleanup
Notice that sysfs_battery_cleanup() calls sysfs_remove_battery() under battery->update_lock which is also done in acpi_battery_remove(), so adjust the latter to use it. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/1866517.TLkxdtWsSY@rafael.j.wysocki
1 parent 08b54fd commit 0d17aaf

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/acpi/battery.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,9 +1279,7 @@ static void acpi_battery_remove(struct acpi_device *device)
12791279
device_init_wakeup(&device->dev, 0);
12801280
unregister_pm_notifier(&battery->pm_nb);
12811281

1282-
guard(mutex)(&battery->update_lock);
1283-
1284-
sysfs_remove_battery(battery);
1282+
sysfs_battery_cleanup(battery);
12851283
}
12861284

12871285
/* this is needed to learn about changes made in suspended state */

0 commit comments

Comments
 (0)