diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-06-04 19:15:40 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2008-07-16 17:27:02 -0400 |
commit | 2fe2de5f6c283a7d2a82c1b99a19012079cee555 (patch) | |
tree | 7f1b37b9b9d6e2be48650d50c93041be6f52d99b | |
parent | cc7e51666d82aedfd6b9a033ca1a10d71c21f1ca (diff) |
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: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/acpi/sleep/main.c | 8 | ||||
-rw-r--r-- | drivers/pci/pci-acpi.c | 3 | ||||
-rw-r--r-- | drivers/pnp/pnpacpi/core.c | 4 | ||||
-rw-r--r-- | include/acpi/acpi_bus.h | 4 |
4 files changed, 8 insertions, 11 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 495c63a3e0a..b45806d7728 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -368,8 +368,8 @@ int acpi_suspend(u32 acpi_state) | |||
368 | /** | 368 | /** |
369 | * acpi_pm_device_sleep_state - return preferred power state of ACPI device | 369 | * acpi_pm_device_sleep_state - return preferred power state of ACPI device |
370 | * in the system sleep state given by %acpi_target_sleep_state | 370 | * in the system sleep state given by %acpi_target_sleep_state |
371 | * @dev: device to examine | 371 | * @dev: device to examine; its driver model wakeup flags control |
372 | * @wake: if set, the device should be able to wake up the system | 372 | * whether it should be able to wake up the system |
373 | * @d_min_p: used to store the upper limit of allowed states range | 373 | * @d_min_p: used to store the upper limit of allowed states range |
374 | * Return value: preferred power state of the device on success, -ENODEV on | 374 | * Return value: preferred power state of the device on success, -ENODEV on |
375 | * failure (ie. if there's no 'struct acpi_device' for @dev) | 375 | * failure (ie. if there's no 'struct acpi_device' for @dev) |
@@ -387,7 +387,7 @@ int acpi_suspend(u32 acpi_state) | |||
387 | * via @wake. | 387 | * via @wake. |
388 | */ | 388 | */ |
389 | 389 | ||
390 | int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p) | 390 | int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p) |
391 | { | 391 | { |
392 | acpi_handle handle = DEVICE_ACPI_HANDLE(dev); | 392 | acpi_handle handle = DEVICE_ACPI_HANDLE(dev); |
393 | struct acpi_device *adev; | 393 | struct acpi_device *adev; |
@@ -426,7 +426,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p) | |||
426 | * can wake the system. _S0W may be valid, too. | 426 | * can wake the system. _S0W may be valid, too. |
427 | */ | 427 | */ |
428 | if (acpi_target_sleep_state == ACPI_STATE_S0 || | 428 | if (acpi_target_sleep_state == ACPI_STATE_S0 || |
429 | (wake && adev->wakeup.state.enabled && | 429 | (device_may_wakeup(dev) && adev->wakeup.state.enabled && |
430 | adev->wakeup.sleep_state <= acpi_target_sleep_state)) { | 430 | adev->wakeup.sleep_state <= acpi_target_sleep_state)) { |
431 | acpi_status status; | 431 | acpi_status status; |
432 | 432 | ||
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 9d6fc8e6285..caabf0573c3 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -298,8 +298,7 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev, | |||
298 | { | 298 | { |
299 | int acpi_state; | 299 | int acpi_state; |
300 | 300 | ||
301 | acpi_state = acpi_pm_device_sleep_state(&pdev->dev, | 301 | acpi_state = acpi_pm_device_sleep_state(&pdev->dev, NULL); |
302 | device_may_wakeup(&pdev->dev), NULL); | ||
303 | if (acpi_state < 0) | 302 | if (acpi_state < 0) |
304 | return PCI_POWER_ERROR; | 303 | return PCI_POWER_ERROR; |
305 | 304 | ||
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 50902773bea..c1b9ea34977 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
@@ -117,9 +117,7 @@ static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state) | |||
117 | { | 117 | { |
118 | int power_state; | 118 | int power_state; |
119 | 119 | ||
120 | power_state = acpi_pm_device_sleep_state(&dev->dev, | 120 | power_state = acpi_pm_device_sleep_state(&dev->dev, NULL); |
121 | device_may_wakeup(&dev->dev), | ||
122 | NULL); | ||
123 | if (power_state < 0) | 121 | if (power_state < 0) |
124 | power_state = (state.event == PM_EVENT_ON) ? | 122 | power_state = (state.event == PM_EVENT_ON) ? |
125 | ACPI_STATE_D0 : ACPI_STATE_D3; | 123 | ACPI_STATE_D0 : ACPI_STATE_D3; |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 2f1c68c7a72..db90a74f871 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -376,9 +376,9 @@ acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); | |||
376 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) | 376 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) |
377 | 377 | ||
378 | #ifdef CONFIG_PM_SLEEP | 378 | #ifdef CONFIG_PM_SLEEP |
379 | int acpi_pm_device_sleep_state(struct device *, int, int *); | 379 | int acpi_pm_device_sleep_state(struct device *, int *); |
380 | #else /* !CONFIG_PM_SLEEP */ | 380 | #else /* !CONFIG_PM_SLEEP */ |
381 | static inline int acpi_pm_device_sleep_state(struct device *d, int w, int *p) | 381 | static inline int acpi_pm_device_sleep_state(struct device *d, int *p) |
382 | { | 382 | { |
383 | if (p) | 383 | if (p) |
384 | *p = ACPI_STATE_D0; | 384 | *p = ACPI_STATE_D0; |