From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: "Hans de Goede" <hdegoede@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
"Linux PM" <linux-pm@vger.kernel.org>,
"Thomas Weißschuh" <linux@weissschuh.net>,
"Armin Wolf" <w_armin@gmx.de>
Subject: [PATCH v1 08/10] ACPI: battery: Adjust event notification routine
Date: Tue, 09 Dec 2025 14:57:41 +0100 [thread overview]
Message-ID: <1996647.taCxCBeP46@rafael.j.wysocki> (raw)
In-Reply-To: <2339822.iZASKD2KPV@rafael.j.wysocki>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.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@intel.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;
next prev parent reply other threads:[~2025-12-09 14:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 13:49 [PATCH v1 10/10] ACPI: Convert button and battery drivers to platform ones Rafael J. Wysocki
2025-12-09 13:53 ` [PATCH v1 01/10] ACPI: scan: Register platform devices for fixed event buttons Rafael J. Wysocki
2025-12-09 13:53 ` [PATCH v1 02/10] ACPI: scan: Reduce code duplication related to fixed event devices Rafael J. Wysocki
2025-12-09 13:53 ` [PATCH v1 03/10] ACPI: button: Adjust event notification routines Rafael J. Wysocki
2025-12-09 13:54 ` [PATCH v1 04/10] ACPI: button: Convert the driver to a platform one Rafael J. Wysocki
2025-12-09 13:55 ` [PATCH v1 05/10] ACPI: tiny-power-button: " Rafael J. Wysocki
2025-12-09 13:56 ` [PATCH v1 06/10] ACPI: scan: Do not bind ACPI drivers to fixed event buttons Rafael J. Wysocki
2025-12-09 13:56 ` [PATCH v1 07/10] ACPI: scan: Do not mark button ACPI devices as wakeup-capable Rafael J. Wysocki
2025-12-09 13:57 ` Rafael J. Wysocki [this message]
2025-12-09 13:58 ` [PATCH v1 09/10] ACPI: battery: Reduce code duplication related to cleanup Rafael J. Wysocki
2025-12-09 13:59 ` [PATCH v1 10/10] ACPI: battery: Convert the driver to a platform one Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1996647.taCxCBeP46@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=hdegoede@redhat.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=w_armin@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox