]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ACPI: PM: Register wakeup sources under physical devices
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 15 Dec 2025 12:49:17 +0000 (13:49 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 17 Dec 2025 12:52:53 +0000 (13:52 +0100)
Currently, acpi_add_pm_notifier() registers wakeup sources under
ACPI companions of the devices affected by the handling of wakeup
events which goes against the rule that a struct acpi_device
can only be a parent of another struct acpi_device.

Moreover, it would be more logically consistent to register wakeup
sources under the devices affected by wakeup events handling which
would cause them to appear in more suitable places in sysfs and would
help to identify the devices they are associated with more easily.

Accordingly, update acpi_add_pm_notifier() to register wakeup sources
under the "target" devices directly instead of registering them under
the ACPI companions of those devices.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/1944126.tdWV9SEqCh@rafael.j.wysocki
drivers/acpi/device_pm.c

index 4e0583274b8f4fe6bacf2bcdfbcd3d0747c8cfe6..cff3186aa945328c37f1e9c9188e13efbbe82444 100644 (file)
@@ -586,8 +586,7 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev,
                goto out;
 
        mutex_lock(&acpi_pm_notifier_lock);
-       adev->wakeup.ws = wakeup_source_register(&adev->dev,
-                                                dev_name(&adev->dev));
+       adev->wakeup.ws = wakeup_source_register(dev, dev_name(&adev->dev));
        adev->wakeup.context.dev = dev;
        adev->wakeup.context.func = func;
        adev->wakeup.flags.notifier_present = true;