]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ACPI PM: acpi_pm_device_sleep_state() cleanup
authorDavid Brownell <dbrownell@users.sourceforge.net>
Wed, 4 Jun 2008 23:15:40 +0000 (01:15 +0200)
committerAndi Kleen <andi@basil.nowhere.org>
Wed, 16 Jul 2008 21:27:02 +0000 (23:27 +0200)
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>
drivers/acpi/sleep/main.c
drivers/pci/pci-acpi.c
drivers/pnp/pnpacpi/core.c
include/acpi/acpi_bus.h

index 495c63a3e0afb1fce2e4fcb6801020ad2f8413ad..b45806d77288b4d5d7bff00a5ab33dd43567fe37 100644 (file)
@@ -368,8 +368,8 @@ int acpi_suspend(u32 acpi_state)
 /**
  *     acpi_pm_device_sleep_state - return preferred power state of ACPI device
  *             in the system sleep state given by %acpi_target_sleep_state
- *     @dev: device to examine
- *     @wake: if set, the device should be able to wake up the system
+ *     @dev: device to examine; its driver model wakeup flags control
+ *             whether it should be able to wake up the system
  *     @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
  *             failure (ie. if there's no 'struct acpi_device' for @dev)
@@ -387,7 +387,7 @@ int acpi_suspend(u32 acpi_state)
  *     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);
        struct acpi_device *adev;
@@ -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.
         */
        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)) {
                acpi_status status;
 
index 9d6fc8e6285d0c557a5e1778e468f49066ff4da5..caabf0573c3d242a8e6a9889910f89d91f76703f 100644 (file)
@@ -298,8 +298,7 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev,
 {
        int acpi_state;
 
-       acpi_state = acpi_pm_device_sleep_state(&pdev->dev,
-               device_may_wakeup(&pdev->dev), NULL);
+       acpi_state = acpi_pm_device_sleep_state(&pdev->dev, NULL);
        if (acpi_state < 0)
                return PCI_POWER_ERROR;
 
index 50902773beaf9092fd0a241d535835a8839c843b..c1b9ea34977b395c400fcd522ecd41f06fadbd21 100644 (file)
@@ -117,9 +117,7 @@ static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state)
 {
        int power_state;
 
-       power_state = acpi_pm_device_sleep_state(&dev->dev,
-                                               device_may_wakeup(&dev->dev),
-                                               NULL);
+       power_state = acpi_pm_device_sleep_state(&dev->dev, NULL);
        if (power_state < 0)
                power_state = (state.event == PM_EVENT_ON) ?
                                ACPI_STATE_D0 : ACPI_STATE_D3;
index 2f1c68c7a7270ea7098a39509690eb5d03614c1d..db90a74f8714052fadfc424aff91c862b328a80d 100644 (file)
@@ -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))
 
 #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 */
-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)
                *p = ACPI_STATE_D0;