ACPI / PM: Convert acpi_dev_pm_detach() into a static function
The ->detach() callback for the PM domain has now been fully adopted, thus there no users left of the acpi_dev_pm_detach() API. This allow us to convert it into a static function. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
a4a8c2c496
commit
91d66cd27f
|
@ -1040,6 +1040,40 @@ static struct dev_pm_domain acpi_general_pm_domain = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* acpi_dev_pm_detach - Remove ACPI power management from the device.
|
||||||
|
* @dev: Device to take care of.
|
||||||
|
* @power_off: Whether or not to try to remove power from the device.
|
||||||
|
*
|
||||||
|
* Remove the device from the general ACPI PM domain and remove its wakeup
|
||||||
|
* notifier. If @power_off is set, additionally remove power from the device if
|
||||||
|
* possible.
|
||||||
|
*
|
||||||
|
* Callers must ensure proper synchronization of this function with power
|
||||||
|
* management callbacks.
|
||||||
|
*/
|
||||||
|
static void acpi_dev_pm_detach(struct device *dev, bool power_off)
|
||||||
|
{
|
||||||
|
struct acpi_device *adev = ACPI_COMPANION(dev);
|
||||||
|
|
||||||
|
if (adev && dev->pm_domain == &acpi_general_pm_domain) {
|
||||||
|
dev->pm_domain = NULL;
|
||||||
|
acpi_remove_pm_notifier(adev);
|
||||||
|
if (power_off) {
|
||||||
|
/*
|
||||||
|
* If the device's PM QoS resume latency limit or flags
|
||||||
|
* have been exposed to user space, they have to be
|
||||||
|
* hidden at this point, so that they don't affect the
|
||||||
|
* choice of the low-power state to put the device into.
|
||||||
|
*/
|
||||||
|
dev_pm_qos_hide_latency_limit(dev);
|
||||||
|
dev_pm_qos_hide_flags(dev);
|
||||||
|
acpi_device_wakeup(adev, ACPI_STATE_S0, false);
|
||||||
|
acpi_dev_pm_low_power(dev, adev, ACPI_STATE_S0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* acpi_dev_pm_attach - Prepare device for ACPI power management.
|
* acpi_dev_pm_attach - Prepare device for ACPI power management.
|
||||||
* @dev: Device to prepare.
|
* @dev: Device to prepare.
|
||||||
|
@ -1077,39 +1111,4 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);
|
EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);
|
||||||
|
|
||||||
/**
|
|
||||||
* acpi_dev_pm_detach - Remove ACPI power management from the device.
|
|
||||||
* @dev: Device to take care of.
|
|
||||||
* @power_off: Whether or not to try to remove power from the device.
|
|
||||||
*
|
|
||||||
* Remove the device from the general ACPI PM domain and remove its wakeup
|
|
||||||
* notifier. If @power_off is set, additionally remove power from the device if
|
|
||||||
* possible.
|
|
||||||
*
|
|
||||||
* Callers must ensure proper synchronization of this function with power
|
|
||||||
* management callbacks.
|
|
||||||
*/
|
|
||||||
void acpi_dev_pm_detach(struct device *dev, bool power_off)
|
|
||||||
{
|
|
||||||
struct acpi_device *adev = ACPI_COMPANION(dev);
|
|
||||||
|
|
||||||
if (adev && dev->pm_domain == &acpi_general_pm_domain) {
|
|
||||||
dev->pm_domain = NULL;
|
|
||||||
acpi_remove_pm_notifier(adev);
|
|
||||||
if (power_off) {
|
|
||||||
/*
|
|
||||||
* If the device's PM QoS resume latency limit or flags
|
|
||||||
* have been exposed to user space, they have to be
|
|
||||||
* hidden at this point, so that they don't affect the
|
|
||||||
* choice of the low-power state to put the device into.
|
|
||||||
*/
|
|
||||||
dev_pm_qos_hide_latency_limit(dev);
|
|
||||||
dev_pm_qos_hide_flags(dev);
|
|
||||||
acpi_device_wakeup(adev, ACPI_STATE_S0, false);
|
|
||||||
acpi_dev_pm_low_power(dev, adev, ACPI_STATE_S0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(acpi_dev_pm_detach);
|
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM */
|
||||||
|
|
|
@ -587,7 +587,6 @@ static inline int acpi_subsys_freeze(struct device *dev) { return 0; }
|
||||||
#if defined(CONFIG_ACPI) && defined(CONFIG_PM)
|
#if defined(CONFIG_ACPI) && defined(CONFIG_PM)
|
||||||
struct acpi_device *acpi_dev_pm_get_node(struct device *dev);
|
struct acpi_device *acpi_dev_pm_get_node(struct device *dev);
|
||||||
int acpi_dev_pm_attach(struct device *dev, bool power_on);
|
int acpi_dev_pm_attach(struct device *dev, bool power_on);
|
||||||
void acpi_dev_pm_detach(struct device *dev, bool power_off);
|
|
||||||
#else
|
#else
|
||||||
static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
|
static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
|
||||||
{
|
{
|
||||||
|
@ -597,7 +596,6 @@ static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
|
||||||
{
|
{
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
static inline void acpi_dev_pm_detach(struct device *dev, bool power_off) {}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ACPI
|
#ifdef CONFIG_ACPI
|
||||||
|
|
Loading…
Reference in New Issue