Commit 6e86633a authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPI: PM: s2idle: Eliminate acpi_sleep_no_ec_events()

Change acpi_ec_suspend() to use pm_suspend_no_platform() instead of
acpi_sleep_no_ec_events(), which allows the latter to be eliminated
along with the s2idle_in_progress variable which is only used by it.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
parent fcd0a042
...@@ -1941,7 +1941,7 @@ static int acpi_ec_suspend(struct device *dev) ...@@ -1941,7 +1941,7 @@ static int acpi_ec_suspend(struct device *dev)
struct acpi_ec *ec = struct acpi_ec *ec =
acpi_driver_data(to_acpi_device(dev)); acpi_driver_data(to_acpi_device(dev));
if (acpi_sleep_no_ec_events() && ec_freeze_events) if (!pm_suspend_no_platform() && ec_freeze_events)
acpi_ec_disable_event(ec); acpi_ec_disable_event(ec);
return 0; return 0;
} }
......
...@@ -210,11 +210,9 @@ void acpi_ec_flush_work(void); ...@@ -210,11 +210,9 @@ void acpi_ec_flush_work(void);
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#ifdef CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT #ifdef CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT
extern bool acpi_s2idle_wakeup(void); extern bool acpi_s2idle_wakeup(void);
extern bool acpi_sleep_no_ec_events(void);
extern int acpi_sleep_init(void); extern int acpi_sleep_init(void);
#else #else
static inline bool acpi_s2idle_wakeup(void) { return false; } static inline bool acpi_s2idle_wakeup(void) { return false; }
static inline bool acpi_sleep_no_ec_events(void) { return true; }
static inline int acpi_sleep_init(void) { return -ENXIO; } static inline int acpi_sleep_init(void) { return -ENXIO; }
#endif #endif
......
...@@ -696,7 +696,6 @@ static const struct platform_suspend_ops acpi_suspend_ops_old = { ...@@ -696,7 +696,6 @@ static const struct platform_suspend_ops acpi_suspend_ops_old = {
.recover = acpi_pm_finish, .recover = acpi_pm_finish,
}; };
static bool s2idle_in_progress;
static bool s2idle_wakeup; static bool s2idle_wakeup;
/* /*
...@@ -950,7 +949,6 @@ static struct acpi_scan_handler lps0_handler = { ...@@ -950,7 +949,6 @@ static struct acpi_scan_handler lps0_handler = {
static int acpi_s2idle_begin(void) static int acpi_s2idle_begin(void)
{ {
acpi_scan_lock_acquire(); acpi_scan_lock_acquire();
s2idle_in_progress = true;
return 0; return 0;
} }
...@@ -1032,7 +1030,6 @@ static void acpi_s2idle_restore(void) ...@@ -1032,7 +1030,6 @@ static void acpi_s2idle_restore(void)
static void acpi_s2idle_end(void) static void acpi_s2idle_end(void)
{ {
s2idle_in_progress = false;
acpi_scan_lock_release(); acpi_scan_lock_release();
} }
...@@ -1060,7 +1057,6 @@ static void acpi_sleep_suspend_setup(void) ...@@ -1060,7 +1057,6 @@ static void acpi_sleep_suspend_setup(void)
} }
#else /* !CONFIG_SUSPEND */ #else /* !CONFIG_SUSPEND */
#define s2idle_in_progress (false)
#define s2idle_wakeup (false) #define s2idle_wakeup (false)
#define lps0_device_handle (NULL) #define lps0_device_handle (NULL)
static inline void acpi_sleep_suspend_setup(void) {} static inline void acpi_sleep_suspend_setup(void) {}
...@@ -1071,11 +1067,6 @@ bool acpi_s2idle_wakeup(void) ...@@ -1071,11 +1067,6 @@ bool acpi_s2idle_wakeup(void)
return s2idle_wakeup; return s2idle_wakeup;
} }
bool acpi_sleep_no_ec_events(void)
{
return !s2idle_in_progress;
}
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static u32 saved_bm_rld; static u32 saved_bm_rld;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment