[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1996647.taCxCBeP46@rafael.j.wysocki>
Date: Tue, 09 Dec 2025 14:57:41 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Linux ACPI <linux-acpi@...r.kernel.org>
Cc: Hans de Goede <hdegoede@...hat.com>, LKML <linux-kernel@...r.kernel.org>,
Linux PM <linux-pm@...r.kernel.org>,
Thomas Weißschuh <linux@...ssschuh.net>,
Armin Wolf <w_armin@....de>
Subject: [PATCH v1 08/10] ACPI: battery: Adjust event notification routine
From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Adjust acpi_battery_notify() to cast its "data" argument to a struct
acpi_battery pointer instead 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@...el.com>
---
drivers/acpi/battery.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -1054,8 +1054,8 @@ static void acpi_battery_refresh(struct
/* 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_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;
Powered by blists - more mailing lists