diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-12-15 17:01:53 +0300 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-12-26 17:11:38 +0300 |
| commit | 08b54fd577825d922a2263f3dcf8481e3720d606 (patch) | |
| tree | 0a1b2665eb1a0447c3e3ace99b5691ff823df007 | |
| parent | 9448598b22c50c8a5bb77a9103e2d49f134c9578 (diff) | |
| download | linux-08b54fd577825d922a2263f3dcf8481e3720d606.tar.xz | |
ACPI: battery: Adjust event notification routine
Adjust acpi_battery_notify() to cast its "data" argument to a struct
acpi_battery pointer istead of a struct acpi_device one, which allows
the use of acpi_driver_data() to be limited and will facilitate
subsequent changes.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/4344406.1IzOArtZ34@rafael.j.wysocki
| -rw-r--r-- | drivers/acpi/battery.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 34181fa52e93..582c35fc8d03 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -1054,8 +1054,8 @@ static void acpi_battery_refresh(struct acpi_battery *battery) /* Driver Interface */ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) { - struct acpi_device *device = data; - struct acpi_battery *battery = acpi_driver_data(device); + struct acpi_battery *battery = data; + struct acpi_device *device = battery->device; struct power_supply *old; if (!battery) @@ -1249,7 +1249,7 @@ static int acpi_battery_add(struct acpi_device *device) device_init_wakeup(&device->dev, 1); result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY, - acpi_battery_notify, device); + acpi_battery_notify, battery); if (result) goto fail_pm; |
