From: "Rafael J. Wysocki" <rafael@kernel.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Hans de Goede <hansg@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux ACPI <linux-acpi@vger.kernel.org>,
platform-driver-x86@vger.kernel.org
Subject: [PATCH v1 1/2] platform/x86: acer-wireless: Register ACPI notify handler directly
Date: Sat, 28 Feb 2026 16:18:01 +0100 [thread overview]
Message-ID: <10810967.nUPlyArG6x@rafael.j.wysocki> (raw)
In-Reply-To: <3406021.44csPzL39Z@rafael.j.wysocki>
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
To facilitate subsequent conversion of the driver to a platform one,
make it install an ACPI notify handler directly instead of using
a .notify() callback in struct acpi_driver.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/platform/x86/acer-wireless.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/acer-wireless.c b/drivers/platform/x86/acer-wireless.c
index 1b5d935d085a..f44d65d97023 100644
--- a/drivers/platform/x86/acer-wireless.c
+++ b/drivers/platform/x86/acer-wireless.c
@@ -18,8 +18,9 @@ static const struct acpi_device_id acer_wireless_acpi_ids[] = {
};
MODULE_DEVICE_TABLE(acpi, acer_wireless_acpi_ids);
-static void acer_wireless_notify(struct acpi_device *adev, u32 event)
+static void acer_wireless_notify(acpi_handle handle, u32 event, void *data)
{
+ struct acpi_device *adev = data;
struct input_dev *idev = acpi_driver_data(adev);
dev_dbg(&adev->dev, "event=%#x\n", event);
@@ -36,6 +37,7 @@ static void acer_wireless_notify(struct acpi_device *adev, u32 event)
static int acer_wireless_add(struct acpi_device *adev)
{
struct input_dev *idev;
+ int ret;
idev = devm_input_allocate_device(&adev->dev);
if (!idev)
@@ -50,7 +52,18 @@ static int acer_wireless_add(struct acpi_device *adev)
set_bit(EV_KEY, idev->evbit);
set_bit(KEY_RFKILL, idev->keybit);
- return input_register_device(idev);
+ ret = input_register_device(idev);
+ if (ret)
+ return ret;
+
+ return acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
+ acer_wireless_notify, adev);
+}
+
+static void acer_wireless_remove(struct acpi_device *adev)
+{
+ acpi_dev_remove_notify_handler(adev, ACPI_DEVICE_NOTIFY,
+ acer_wireless_notify);
}
static struct acpi_driver acer_wireless_driver = {
@@ -59,7 +72,7 @@ static struct acpi_driver acer_wireless_driver = {
.ids = acer_wireless_acpi_ids,
.ops = {
.add = acer_wireless_add,
- .notify = acer_wireless_notify,
+ .remove = acer_wireless_remove,
},
};
module_acpi_driver(acer_wireless_driver);
--
2.51.0
next prev parent reply other threads:[~2026-02-28 15:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-28 15:17 [PATCH v1 0/2] platform/x86: acer-wireless: Bind to a platform device instead of an ACPI one Rafael J. Wysocki
2026-02-28 15:18 ` Rafael J. Wysocki [this message]
2026-02-28 15:18 ` [PATCH v1 2/2] platform/x86: acer-wireless: Convert ACPI driver to a platform one Rafael J. Wysocki
2026-03-09 14:58 ` [PATCH v1 0/2] platform/x86: acer-wireless: Bind to a platform device instead of an ACPI one Ilpo Järvinen
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=10810967.nUPlyArG6x@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/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