Linux ACPI
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Linux PM <linux-pm@vger.kernel.org>
Subject: [PATCH v1 1/2] ACPI: button: Tweak system wakeup handling
Date: Thu, 12 Feb 2026 14:31:33 +0100	[thread overview]
Message-ID: <1948258.tdWV9SEqCh@rafael.j.wysocki> (raw)
In-Reply-To: <2400697.ElGaqSPkdT@rafael.j.wysocki>

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Modify struct acpi_button to hold a struct device pointer instead
of a struct platform_device one to avoid unnecessary pointer
dereferences and use that pointer consistently for system wakeup
initialization, handling and cleanup.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/button.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -170,7 +170,7 @@ static struct platform_driver acpi_butto
 
 struct acpi_button {
 	struct acpi_device *adev;
-	struct platform_device *pdev;
+	struct device *dev;		/* physical button device */
 	unsigned int type;
 	struct input_dev *input;
 	char phys[32];			/* for input device */
@@ -398,7 +398,7 @@ static int acpi_lid_update_state(struct
 		return state;
 
 	if (state && signal_wakeup)
-		acpi_pm_wakeup_event(&button->pdev->dev);
+		acpi_pm_wakeup_event(button->dev);
 
 	return acpi_lid_notify_state(button, state);
 }
@@ -455,7 +455,7 @@ static void acpi_button_notify(acpi_hand
 		return;
 	}
 
-	acpi_pm_wakeup_event(&button->pdev->dev);
+	acpi_pm_wakeup_event(button->dev);
 
 	if (button->suspended || event == ACPI_BUTTON_NOTIFY_WAKE)
 		return;
@@ -550,7 +550,7 @@ static int acpi_button_probe(struct plat
 
 	platform_set_drvdata(pdev, button);
 
-	button->pdev = pdev;
+	button->dev = &pdev->dev;
 	button->adev = device;
 	button->input = input = input_allocate_device();
 	if (!input) {
@@ -625,7 +625,7 @@ static int acpi_button_probe(struct plat
 		goto err_remove_fs;
 	}
 
-	device_init_wakeup(&pdev->dev, true);
+	device_init_wakeup(button->dev, true);
 
 	switch (device->device_type) {
 	case ACPI_BUS_TYPE_POWER_BUTTON:
@@ -661,7 +661,7 @@ static int acpi_button_probe(struct plat
 	return 0;
 
 err_input_unregister:
-	device_init_wakeup(&pdev->dev, false);
+	device_init_wakeup(button->dev, false);
 	input_unregister_device(input);
 err_remove_fs:
 	acpi_button_remove_fs(button);
@@ -693,7 +693,7 @@ static void acpi_button_remove(struct pl
 	}
 	acpi_os_wait_events_complete();
 
-	device_init_wakeup(&pdev->dev, false);
+	device_init_wakeup(button->dev, false);
 
 	acpi_button_remove_fs(button);
 	input_unregister_device(button->input);




  reply	other threads:[~2026-02-12 13:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 13:29 [PATCH v1 0/2] ACPI: button: Cleanups after recent changes Rafael J. Wysocki
2026-02-12 13:31 ` Rafael J. Wysocki [this message]
2026-02-12 13:33 ` [PATCH v1 2/2] ACPI: button: Tweak acpi_button_remove() 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=1948258.tdWV9SEqCh@rafael.j.wysocki \
    --to=rafael@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@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