ACPI / PM: Rename function acpi_device_power_state() and make it static
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 15 Jun 2013 22:37:42 +0000 (00:37 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 19 Jun 2013 21:37:08 +0000 (23:37 +0200)
There is a name clash between function acpi_device_power_state()
defined in drivers/acpi/device_pm.c and structure type
acpi_device_power_state defined in include/acpi/acpi_bus.h, which
may be resolved by renaming the function.  Additionally, that
funtion may be made static, because it is not used anywhere outside
of the file it is defined in.

Rename acpi_device_power_state() to acpi_dev_pm_get_state(), which
better reflects its purpose, and make it static.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/device_pm.c
include/acpi/acpi_bus.h

index 318fa32..26d3fd7 100644 (file)
@@ -399,7 +399,7 @@ bool acpi_bus_can_wakeup(acpi_handle handle)
 EXPORT_SYMBOL(acpi_bus_can_wakeup);
 
 /**
- * acpi_device_power_state - Get preferred power state of ACPI device.
+ * acpi_dev_pm_get_state - Get preferred power state of ACPI device.
  * @dev: Device whose preferred target power state to return.
  * @adev: ACPI device node corresponding to @dev.
  * @target_state: System state to match the resultant device state.
@@ -417,8 +417,8 @@ EXPORT_SYMBOL(acpi_bus_can_wakeup);
  * Callers must ensure that @dev and @adev are valid pointers and that @adev
  * actually corresponds to @dev before using this function.
  */
-int acpi_device_power_state(struct device *dev, struct acpi_device *adev,
-                           u32 target_state, int d_max_in, int *d_min_p)
+static int acpi_dev_pm_get_state(struct device *dev, struct acpi_device *adev,
+                                u32 target_state, int d_max_in, int *d_min_p)
 {
        char acpi_method[] = "_SxD";
        unsigned long long d_min, d_max;
@@ -501,7 +501,6 @@ int acpi_device_power_state(struct device *dev, struct acpi_device *adev,
        }
        return d_max;
 }
-EXPORT_SYMBOL_GPL(acpi_device_power_state);
 
 /**
  * acpi_pm_device_sleep_state - Get preferred power state of ACPI device.
@@ -523,8 +522,8 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in)
                return -ENODEV;
        }
 
-       return acpi_device_power_state(dev, adev, acpi_target_system_state(),
-                                      d_max_in, d_min_p);
+       return acpi_dev_pm_get_state(dev, adev, acpi_target_system_state(),
+                                    d_max_in, d_min_p);
 }
 EXPORT_SYMBOL(acpi_pm_device_sleep_state);
 
@@ -680,8 +679,8 @@ static int acpi_dev_pm_low_power(struct device *dev, struct acpi_device *adev,
        if (!acpi_device_power_manageable(adev))
                return 0;
 
-       power_state = acpi_device_power_state(dev, adev, system_state,
-                                             ACPI_STATE_D3, NULL);
+       power_state = acpi_dev_pm_get_state(dev, adev, system_state,
+                                           ACPI_STATE_D3, NULL);
        if (power_state < ACPI_STATE_D0 || power_state > ACPI_STATE_D3)
                return -EIO;
 
index 636c59f..c3dc203 100644 (file)
@@ -467,8 +467,6 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
                                 acpi_notify_handler handler, void *context);
 acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
                                    acpi_notify_handler handler);
-int acpi_device_power_state(struct device *dev, struct acpi_device *adev,
-                           u32 target_state, int d_max_in, int *d_min_p);
 int acpi_pm_device_sleep_state(struct device *, int *, int);
 void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev);
 void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev);
@@ -484,23 +482,13 @@ static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
 {
        return AE_SUPPORT;
 }
-static inline int __acpi_device_power_state(int m, int *p)
+static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
 {
        if (p)
                *p = ACPI_STATE_D0;
+
        return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0;
 }
-static inline int acpi_device_power_state(struct device *dev,
-                                         struct acpi_device *adev,
-                                         u32 target_state, int d_max_in,
-                                         int *d_min_p)
-{
-       return __acpi_device_power_state(d_max_in, d_min_p);
-}
-static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
-{
-       return __acpi_device_power_state(m, p);
-}
 static inline void acpi_dev_pm_add_dependent(acpi_handle handle,
                                             struct device *depdev) {}
 static inline void acpi_dev_pm_remove_dependent(acpi_handle handle,