aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-15 18:37:42 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-19 17:37:08 -0400
commitb25c77efa71178f8281401e492e5c63cf7c34900 (patch)
treed06c5e6d10d84fcfb5880fa62d8dda98fdb3a8a9
parent95d45d4cab6540e3f2183d86662c255fa4332331 (diff)
ACPI / PM: Rename function acpi_device_power_state() and make it static
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>
-rw-r--r--drivers/acpi/device_pm.c15
-rw-r--r--include/acpi/acpi_bus.h16
2 files changed, 9 insertions, 22 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 318fa32a141e..26d3fd718a04 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -399,7 +399,7 @@ bool acpi_bus_can_wakeup(acpi_handle handle)
399EXPORT_SYMBOL(acpi_bus_can_wakeup); 399EXPORT_SYMBOL(acpi_bus_can_wakeup);
400 400
401/** 401/**
402 * acpi_device_power_state - Get preferred power state of ACPI device. 402 * acpi_dev_pm_get_state - Get preferred power state of ACPI device.
403 * @dev: Device whose preferred target power state to return. 403 * @dev: Device whose preferred target power state to return.
404 * @adev: ACPI device node corresponding to @dev. 404 * @adev: ACPI device node corresponding to @dev.
405 * @target_state: System state to match the resultant device state. 405 * @target_state: System state to match the resultant device state.
@@ -417,8 +417,8 @@ EXPORT_SYMBOL(acpi_bus_can_wakeup);
417 * Callers must ensure that @dev and @adev are valid pointers and that @adev 417 * Callers must ensure that @dev and @adev are valid pointers and that @adev
418 * actually corresponds to @dev before using this function. 418 * actually corresponds to @dev before using this function.
419 */ 419 */
420int acpi_device_power_state(struct device *dev, struct acpi_device *adev, 420static int acpi_dev_pm_get_state(struct device *dev, struct acpi_device *adev,
421 u32 target_state, int d_max_in, int *d_min_p) 421 u32 target_state, int d_max_in, int *d_min_p)
422{ 422{
423 char acpi_method[] = "_SxD"; 423 char acpi_method[] = "_SxD";
424 unsigned long long d_min, d_max; 424 unsigned long long d_min, d_max;
@@ -501,7 +501,6 @@ int acpi_device_power_state(struct device *dev, struct acpi_device *adev,
501 } 501 }
502 return d_max; 502 return d_max;
503} 503}
504EXPORT_SYMBOL_GPL(acpi_device_power_state);
505 504
506/** 505/**
507 * acpi_pm_device_sleep_state - Get preferred power state of ACPI device. 506 * 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)
523 return -ENODEV; 522 return -ENODEV;
524 } 523 }
525 524
526 return acpi_device_power_state(dev, adev, acpi_target_system_state(), 525 return acpi_dev_pm_get_state(dev, adev, acpi_target_system_state(),
527 d_max_in, d_min_p); 526 d_max_in, d_min_p);
528} 527}
529EXPORT_SYMBOL(acpi_pm_device_sleep_state); 528EXPORT_SYMBOL(acpi_pm_device_sleep_state);
530 529
@@ -680,8 +679,8 @@ static int acpi_dev_pm_low_power(struct device *dev, struct acpi_device *adev,
680 if (!acpi_device_power_manageable(adev)) 679 if (!acpi_device_power_manageable(adev))
681 return 0; 680 return 0;
682 681
683 power_state = acpi_device_power_state(dev, adev, system_state, 682 power_state = acpi_dev_pm_get_state(dev, adev, system_state,
684 ACPI_STATE_D3, NULL); 683 ACPI_STATE_D3, NULL);
685 if (power_state < ACPI_STATE_D0 || power_state > ACPI_STATE_D3) 684 if (power_state < ACPI_STATE_D0 || power_state > ACPI_STATE_D3)
686 return -EIO; 685 return -EIO;
687 686
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 636c59f2003a..c3dc203a90f4 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -467,8 +467,6 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
467 acpi_notify_handler handler, void *context); 467 acpi_notify_handler handler, void *context);
468acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, 468acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
469 acpi_notify_handler handler); 469 acpi_notify_handler handler);
470int acpi_device_power_state(struct device *dev, struct acpi_device *adev,
471 u32 target_state, int d_max_in, int *d_min_p);
472int acpi_pm_device_sleep_state(struct device *, int *, int); 470int acpi_pm_device_sleep_state(struct device *, int *, int);
473void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev); 471void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev);
474void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev); 472void 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,
484{ 482{
485 return AE_SUPPORT; 483 return AE_SUPPORT;
486} 484}
487static inline int __acpi_device_power_state(int m, int *p) 485static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
488{ 486{
489 if (p) 487 if (p)
490 *p = ACPI_STATE_D0; 488 *p = ACPI_STATE_D0;
489
491 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0; 490 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0;
492} 491}
493static inline int acpi_device_power_state(struct device *dev,
494 struct acpi_device *adev,
495 u32 target_state, int d_max_in,
496 int *d_min_p)
497{
498 return __acpi_device_power_state(d_max_in, d_min_p);
499}
500static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
501{
502 return __acpi_device_power_state(m, p);
503}
504static inline void acpi_dev_pm_add_dependent(acpi_handle handle, 492static inline void acpi_dev_pm_add_dependent(acpi_handle handle,
505 struct device *depdev) {} 493 struct device *depdev) {}
506static inline void acpi_dev_pm_remove_dependent(acpi_handle handle, 494static inline void acpi_dev_pm_remove_dependent(acpi_handle handle,