]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ACPI: PM: Set .detach in acpi_general_pm_domain definition
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 16 Jun 2025 18:20:28 +0000 (20:20 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 2 Jul 2025 17:31:44 +0000 (19:31 +0200)
Instead of setting the .detach callback pointer for acpi_general_pm_domain
every time it is attached to a device, which is confusing, set it once
in the definition of acpi_general_pm_domain.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://patch.msgid.link/4665476.LvFx2qVVIh@rjwysocki.net
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/device_pm.c

index dbd4446025ecdb9c2e193cf76e983b649aa5e20d..170b8eeaefe2f011dce8a2f6656d00a6dbfce3f0 100644 (file)
@@ -1362,6 +1362,8 @@ static int acpi_subsys_poweroff_noirq(struct device *dev)
 }
 #endif /* CONFIG_PM_SLEEP */
 
+static void acpi_dev_pm_detach(struct device *dev, bool power_off);
+
 static struct dev_pm_domain acpi_general_pm_domain = {
        .ops = {
                .runtime_suspend = acpi_subsys_runtime_suspend,
@@ -1382,6 +1384,7 @@ static struct dev_pm_domain acpi_general_pm_domain = {
                .restore_early = acpi_subsys_restore_early,
 #endif
        },
+       .detach = acpi_dev_pm_detach,
 };
 
 /**
@@ -1465,7 +1468,6 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
                acpi_device_wakeup_disable(adev);
        }
 
-       dev->pm_domain->detach = acpi_dev_pm_detach;
        return 1;
 }
 EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);