From: Rafael J. Wysocki Date: Mon, 15 Dec 2025 14:02:37 +0000 (+0100) Subject: ACPI: battery: Reduce code duplication related to cleanup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d17aafa79c6c5693a740a5b6c2693203e4043ee;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://patch.msgid.link/1866517.TLkxdtWsSY@rafael.j.wysocki --- diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 582c35fc8d03f..4a66c62911028 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -1279,9 +1279,7 @@ static void acpi_battery_remove(struct acpi_device *device) device_init_wakeup(&device->dev, 0); unregister_pm_notifier(&battery->pm_nb); - guard(mutex)(&battery->update_lock); - - sysfs_remove_battery(battery); + sysfs_battery_cleanup(battery); } /* this is needed to learn about changes made in suspended state */