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>
 
 }
 #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,
                .restore_early = acpi_subsys_restore_early,
 #endif
        },
+       .detach = acpi_dev_pm_detach,
 };
 
 /**
                acpi_device_wakeup_disable(adev);
        }
 
-       dev->pm_domain->detach = acpi_dev_pm_detach;
        return 1;
 }
 EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);