Skip to content

Commit 4a89166

Browse files
committed
ACPI: PM: Set .detach in acpi_general_pm_domain definition
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>
1 parent d0b3b7b commit 4a89166

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/acpi/device_pm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,8 @@ static int acpi_subsys_poweroff_noirq(struct device *dev)
13621362
}
13631363
#endif /* CONFIG_PM_SLEEP */
13641364

1365+
static void acpi_dev_pm_detach(struct device *dev, bool power_off);
1366+
13651367
static struct dev_pm_domain acpi_general_pm_domain = {
13661368
.ops = {
13671369
.runtime_suspend = acpi_subsys_runtime_suspend,
@@ -1382,6 +1384,7 @@ static struct dev_pm_domain acpi_general_pm_domain = {
13821384
.restore_early = acpi_subsys_restore_early,
13831385
#endif
13841386
},
1387+
.detach = acpi_dev_pm_detach,
13851388
};
13861389

13871390
/**
@@ -1465,7 +1468,6 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
14651468
acpi_device_wakeup_disable(adev);
14661469
}
14671470

1468-
dev->pm_domain->detach = acpi_dev_pm_detach;
14691471
return 1;
14701472
}
14711473
EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);

0 commit comments

Comments
 (0)