Skip to content

Commit 08b54fd

Browse files
committed
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
1 parent 9448598 commit 08b54fd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/acpi/battery.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,8 +1054,8 @@ static void acpi_battery_refresh(struct acpi_battery *battery)
10541054
/* Driver Interface */
10551055
static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
10561056
{
1057-
struct acpi_device *device = data;
1058-
struct acpi_battery *battery = acpi_driver_data(device);
1057+
struct acpi_battery *battery = data;
1058+
struct acpi_device *device = battery->device;
10591059
struct power_supply *old;
10601060

10611061
if (!battery)
@@ -1249,7 +1249,7 @@ static int acpi_battery_add(struct acpi_device *device)
12491249
device_init_wakeup(&device->dev, 1);
12501250

12511251
result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY,
1252-
acpi_battery_notify, device);
1252+
acpi_battery_notify, battery);
12531253
if (result)
12541254
goto fail_pm;
12551255

0 commit comments

Comments
 (0)