aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-10-10 12:49:22 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-10-11 09:31:55 -0400
commit63705c406a8adbd6f26691148b09d466dd4d8d2f (patch)
tree0b52921af0e414d4be2505bf465ddc3d30dcc595
parent8055af0a4fddb45a8cd925fb9bc71f4b52628c9a (diff)
ACPI / PM: Combine two identical device resume routines
Notice that acpi_dev_runtime_resume() and acpi_dev_resume_early() are actually literally identical after some more-or-less recent changes, so rename acpi_dev_runtime_resume() to acpi_dev_resume(), use it everywhere instead of acpi_dev_resume_early() and drop the latter. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/acpi/acpi_lpss.c6
-rw-r--r--drivers/acpi/device_pm.c35
-rw-r--r--include/linux/acpi.h3
3 files changed, 10 insertions, 34 deletions
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index 032ae44710e5..81b6096c4177 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -693,7 +693,7 @@ static int acpi_lpss_activate(struct device *dev)
693 struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); 693 struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
694 int ret; 694 int ret;
695 695
696 ret = acpi_dev_runtime_resume(dev); 696 ret = acpi_dev_resume(dev);
697 if (ret) 697 if (ret)
698 return ret; 698 return ret;
699 699
@@ -737,7 +737,7 @@ static int acpi_lpss_resume_early(struct device *dev)
737 struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); 737 struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
738 int ret; 738 int ret;
739 739
740 ret = acpi_dev_resume_early(dev); 740 ret = acpi_dev_resume(dev);
741 if (ret) 741 if (ret)
742 return ret; 742 return ret;
743 743
@@ -872,7 +872,7 @@ static int acpi_lpss_runtime_resume(struct device *dev)
872 if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) 872 if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available())
873 lpss_iosf_exit_d3_state(); 873 lpss_iosf_exit_d3_state();
874 874
875 ret = acpi_dev_runtime_resume(dev); 875 ret = acpi_dev_resume(dev);
876 if (ret) 876 if (ret)
877 return ret; 877 return ret;
878 878
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index fbcc73f7a099..6eb51145dcf7 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -882,14 +882,13 @@ int acpi_dev_runtime_suspend(struct device *dev)
882EXPORT_SYMBOL_GPL(acpi_dev_runtime_suspend); 882EXPORT_SYMBOL_GPL(acpi_dev_runtime_suspend);
883 883
884/** 884/**
885 * acpi_dev_runtime_resume - Put device into the full-power state using ACPI. 885 * acpi_dev_resume - Put device into the full-power state using ACPI.
886 * @dev: Device to put into the full-power state. 886 * @dev: Device to put into the full-power state.
887 * 887 *
888 * Put the given device into the full-power state using the standard ACPI 888 * Put the given device into the full-power state using the standard ACPI
889 * mechanism at run time. Set the power state of the device to ACPI D0 and 889 * mechanism. Set the power state of the device to ACPI D0 and disable wakeup.
890 * disable remote wakeup.
891 */ 890 */
892int acpi_dev_runtime_resume(struct device *dev) 891int acpi_dev_resume(struct device *dev)
893{ 892{
894 struct acpi_device *adev = ACPI_COMPANION(dev); 893 struct acpi_device *adev = ACPI_COMPANION(dev);
895 int error; 894 int error;
@@ -901,7 +900,7 @@ int acpi_dev_runtime_resume(struct device *dev)
901 acpi_device_wakeup_disable(adev); 900 acpi_device_wakeup_disable(adev);
902 return error; 901 return error;
903} 902}
904EXPORT_SYMBOL_GPL(acpi_dev_runtime_resume); 903EXPORT_SYMBOL_GPL(acpi_dev_resume);
905 904
906/** 905/**
907 * acpi_subsys_runtime_suspend - Suspend device using ACPI. 906 * acpi_subsys_runtime_suspend - Suspend device using ACPI.
@@ -926,7 +925,7 @@ EXPORT_SYMBOL_GPL(acpi_subsys_runtime_suspend);
926 */ 925 */
927int acpi_subsys_runtime_resume(struct device *dev) 926int acpi_subsys_runtime_resume(struct device *dev)
928{ 927{
929 int ret = acpi_dev_runtime_resume(dev); 928 int ret = acpi_dev_resume(dev);
930 return ret ? ret : pm_generic_runtime_resume(dev); 929 return ret ? ret : pm_generic_runtime_resume(dev);
931} 930}
932EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume); 931EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume);
@@ -968,28 +967,6 @@ int acpi_dev_suspend_late(struct device *dev)
968EXPORT_SYMBOL_GPL(acpi_dev_suspend_late); 967EXPORT_SYMBOL_GPL(acpi_dev_suspend_late);
969 968
970/** 969/**
971 * acpi_dev_resume_early - Put device into the full-power state using ACPI.
972 * @dev: Device to put into the full-power state.
973 *
974 * Put the given device into the full-power state using the standard ACPI
975 * mechanism during system transition to the working state. Set the power
976 * state of the device to ACPI D0 and disable remote wakeup.
977 */
978int acpi_dev_resume_early(struct device *dev)
979{
980 struct acpi_device *adev = ACPI_COMPANION(dev);
981 int error;
982
983 if (!adev)
984 return 0;
985
986 error = acpi_dev_pm_full_power(adev);
987 acpi_device_wakeup_disable(adev);
988 return error;
989}
990EXPORT_SYMBOL_GPL(acpi_dev_resume_early);
991
992/**
993 * acpi_subsys_prepare - Prepare device for system transition to a sleep state. 970 * acpi_subsys_prepare - Prepare device for system transition to a sleep state.
994 * @dev: Device to prepare. 971 * @dev: Device to prepare.
995 */ 972 */
@@ -1057,7 +1034,7 @@ EXPORT_SYMBOL_GPL(acpi_subsys_suspend_late);
1057 */ 1034 */
1058int acpi_subsys_resume_early(struct device *dev) 1035int acpi_subsys_resume_early(struct device *dev)
1059{ 1036{
1060 int ret = acpi_dev_resume_early(dev); 1037 int ret = acpi_dev_resume(dev);
1061 return ret ? ret : pm_generic_resume_early(dev); 1038 return ret ? ret : pm_generic_resume_early(dev);
1062} 1039}
1063EXPORT_SYMBOL_GPL(acpi_subsys_resume_early); 1040EXPORT_SYMBOL_GPL(acpi_subsys_resume_early);
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 3b89b4fe6812..d18c92d4ba19 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -865,7 +865,7 @@ static inline void arch_reserve_mem_area(acpi_physical_address addr,
865 865
866#if defined(CONFIG_ACPI) && defined(CONFIG_PM) 866#if defined(CONFIG_ACPI) && defined(CONFIG_PM)
867int acpi_dev_runtime_suspend(struct device *dev); 867int acpi_dev_runtime_suspend(struct device *dev);
868int acpi_dev_runtime_resume(struct device *dev); 868int acpi_dev_resume(struct device *dev);
869int acpi_subsys_runtime_suspend(struct device *dev); 869int acpi_subsys_runtime_suspend(struct device *dev);
870int acpi_subsys_runtime_resume(struct device *dev); 870int acpi_subsys_runtime_resume(struct device *dev);
871int acpi_dev_pm_attach(struct device *dev, bool power_on); 871int acpi_dev_pm_attach(struct device *dev, bool power_on);
@@ -882,7 +882,6 @@ static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
882 882
883#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) 883#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
884int acpi_dev_suspend_late(struct device *dev); 884int acpi_dev_suspend_late(struct device *dev);
885int acpi_dev_resume_early(struct device *dev);
886int acpi_subsys_prepare(struct device *dev); 885int acpi_subsys_prepare(struct device *dev);
887void acpi_subsys_complete(struct device *dev); 886void acpi_subsys_complete(struct device *dev);
888int acpi_subsys_suspend_late(struct device *dev); 887int acpi_subsys_suspend_late(struct device *dev);