Commit 2fe2de5f authored by David Brownell's avatar David Brownell Committed by Andi Kleen

ACPI PM: acpi_pm_device_sleep_state() cleanup

Get rid of a superfluous acpi_pm_device_sleep_state() parameter.  The
only legitimate value of that parameter must be derived from the first
parameter, which is what all the callers already do.  (However, this
does not address the fact that ACPI still doesn't set up those flags.)
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent cc7e5166
...@@ -368,8 +368,8 @@ int acpi_suspend(u32 acpi_state) ...@@ -368,8 +368,8 @@ int acpi_suspend(u32 acpi_state)
/** /**
* acpi_pm_device_sleep_state - return preferred power state of ACPI device * acpi_pm_device_sleep_state - return preferred power state of ACPI device
* in the system sleep state given by %acpi_target_sleep_state * in the system sleep state given by %acpi_target_sleep_state
* @dev: device to examine * @dev: device to examine; its driver model wakeup flags control
* @wake: if set, the device should be able to wake up the system * whether it should be able to wake up the system
* @d_min_p: used to store the upper limit of allowed states range * @d_min_p: used to store the upper limit of allowed states range
* Return value: preferred power state of the device on success, -ENODEV on * Return value: preferred power state of the device on success, -ENODEV on
* failure (ie. if there's no 'struct acpi_device' for @dev) * failure (ie. if there's no 'struct acpi_device' for @dev)
...@@ -387,7 +387,7 @@ int acpi_suspend(u32 acpi_state) ...@@ -387,7 +387,7 @@ int acpi_suspend(u32 acpi_state)
* via @wake. * via @wake.
*/ */
int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p) int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
{ {
acpi_handle handle = DEVICE_ACPI_HANDLE(dev); acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
struct acpi_device *adev; struct acpi_device *adev;
...@@ -426,7 +426,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p) ...@@ -426,7 +426,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
* can wake the system. _S0W may be valid, too. * can wake the system. _S0W may be valid, too.
*/ */
if (acpi_target_sleep_state == ACPI_STATE_S0 || if (acpi_target_sleep_state == ACPI_STATE_S0 ||
(wake && adev->wakeup.state.enabled && (device_may_wakeup(dev) && adev->wakeup.state.enabled &&
adev->wakeup.sleep_state <= acpi_target_sleep_state)) { adev->wakeup.sleep_state <= acpi_target_sleep_state)) {
acpi_status status; acpi_status status;
......
...@@ -298,8 +298,7 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev, ...@@ -298,8 +298,7 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev,
{ {
int acpi_state; int acpi_state;
acpi_state = acpi_pm_device_sleep_state(&pdev->dev, acpi_state = acpi_pm_device_sleep_state(&pdev->dev, NULL);
device_may_wakeup(&pdev->dev), NULL);
if (acpi_state < 0) if (acpi_state < 0)
return PCI_POWER_ERROR; return PCI_POWER_ERROR;
......
...@@ -117,9 +117,7 @@ static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state) ...@@ -117,9 +117,7 @@ static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state)
{ {
int power_state; int power_state;
power_state = acpi_pm_device_sleep_state(&dev->dev, power_state = acpi_pm_device_sleep_state(&dev->dev, NULL);
device_may_wakeup(&dev->dev),
NULL);
if (power_state < 0) if (power_state < 0)
power_state = (state.event == PM_EVENT_ON) ? power_state = (state.event == PM_EVENT_ON) ?
ACPI_STATE_D0 : ACPI_STATE_D3; ACPI_STATE_D0 : ACPI_STATE_D3;
......
...@@ -376,9 +376,9 @@ acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); ...@@ -376,9 +376,9 @@ acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
int acpi_pm_device_sleep_state(struct device *, int, int *); int acpi_pm_device_sleep_state(struct device *, int *);
#else /* !CONFIG_PM_SLEEP */ #else /* !CONFIG_PM_SLEEP */
static inline int acpi_pm_device_sleep_state(struct device *d, int w, int *p) static inline int acpi_pm_device_sleep_state(struct device *d, int *p)
{ {
if (p) if (p)
*p = ACPI_STATE_D0; *p = ACPI_STATE_D0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment