[PATCH v1 2/6] platform/chrome: chromeos_tbmc: Drop wakeup source on remove

Rafael J. Wysocki posted 1 patch 1 month ago
drivers/platform/chrome/chromeos_tbmc.c | 6 ++++++
1 file changed, 6 insertions(+)
[PATCH v1 2/6] platform/chrome: chromeos_tbmc: Drop wakeup source on remove
Posted by Rafael J. Wysocki 1 month ago
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

The wakeup source added by device_init_wakeup() in chromeos_tbmc_add()
needs to be dropped during driver removal, so add a .remove() callback
to the driver for this purpose.

Fixes: 0144c00ed86b (platform/chrome: chromeos_tbmc: Report wake events)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/platform/chrome/chromeos_tbmc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/platform/chrome/chromeos_tbmc.c b/drivers/platform/chrome/chromeos_tbmc.c
index d1cf8f3463ce..e248567c0a18 100644
--- a/drivers/platform/chrome/chromeos_tbmc.c
+++ b/drivers/platform/chrome/chromeos_tbmc.c
@@ -95,6 +95,11 @@ static int chromeos_tbmc_add(struct acpi_device *adev)
 	return 0;
 }
 
+static void chromeos_tbmc_remove(struct acpi_device *adev)
+{
+	device_init_wakeup(&adev->dev, false);
+}
+
 static const struct acpi_device_id chromeos_tbmc_acpi_device_ids[] = {
 	{ ACPI_DRV_NAME, 0 },
 	{ }
@@ -110,6 +115,7 @@ static struct acpi_driver chromeos_tbmc_driver = {
 	.ids = chromeos_tbmc_acpi_device_ids,
 	.ops = {
 		.add = chromeos_tbmc_add,
+		.remove = chromeos_tbmc_remove,
 		.notify = chromeos_tbmc_notify,
 	},
 	.drv.pm = &chromeos_tbmc_pm_ops,
-- 
2.51.0
Re: [PATCH v1 2/6] platform/chrome: chromeos_tbmc: Drop wakeup source on remove
Posted by Tzung-Bi Shih 1 month ago
On Wed, Mar 04, 2026 at 07:43:05PM +0100, Rafael J. Wysocki wrote:
> From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> 
> The wakeup source added by device_init_wakeup() in chromeos_tbmc_add()
> needs to be dropped during driver removal, so add a .remove() callback
> to the driver for this purpose.
> 
> Fixes: 0144c00ed86b (platform/chrome: chromeos_tbmc: Report wake events)
                      ^                                                  ^
		      "                                                  "
No need to resend just for these.  I'll fix it as well when applying the
patch.
Re: [PATCH v1 2/6] platform/chrome: chromeos_tbmc: Drop wakeup source on remove
Posted by Rafael J. Wysocki 1 month ago
On Thu, Mar 5, 2026 at 4:29 PM Tzung-Bi Shih <tzungbi@kernel.org> wrote:
>
> On Wed, Mar 04, 2026 at 07:43:05PM +0100, Rafael J. Wysocki wrote:
> > From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> >
> > The wakeup source added by device_init_wakeup() in chromeos_tbmc_add()
> > needs to be dropped during driver removal, so add a .remove() callback
> > to the driver for this purpose.
> >
> > Fixes: 0144c00ed86b (platform/chrome: chromeos_tbmc: Report wake events)
>                       ^                                                  ^
>                       "                                                  "
> No need to resend just for these.  I'll fix it as well when applying the
> patch.

Thanks!