lkml.org 
[lkml]   [2022]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] plaform/chrome: Remove SET_LATE_SYSTEM_SLEEP_PM_OPS
Date
commit 296282fca791 ("PM: core: Add new *_PM_OPS macros, deprecate old ones")
introduces LATE_SYSTEM_SLEEP_PM_OPS, so we can remove the #ifdef around
suspend/resume functions.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
drivers/platform/chrome/cros_ec_i2c.c | 6 ++----
drivers/platform/chrome/cros_ec_lpc.c | 6 ++----
2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_i2c.c b/drivers/platform/chrome/cros_ec_i2c.c
index 30c8938c27d54e..b27c15f6774cc9 100644
--- a/drivers/platform/chrome/cros_ec_i2c.c
+++ b/drivers/platform/chrome/cros_ec_i2c.c
@@ -316,7 +316,6 @@ static int cros_ec_i2c_remove(struct i2c_client *client)
return cros_ec_unregister(ec_dev);
}

-#ifdef CONFIG_PM_SLEEP
static int cros_ec_i2c_suspend(struct device *dev)
{
struct cros_ec_device *ec_dev = to_ec_dev(dev);
@@ -330,10 +329,9 @@ static int cros_ec_i2c_resume(struct device *dev)

return cros_ec_resume(ec_dev);
}
-#endif

static const struct dev_pm_ops cros_ec_i2c_pm_ops = {
- SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_i2c_suspend, cros_ec_i2c_resume)
+ LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_i2c_suspend, cros_ec_i2c_resume)
};

#ifdef CONFIG_OF
@@ -363,7 +361,7 @@ static struct i2c_driver cros_ec_driver = {
.name = "cros-ec-i2c",
.acpi_match_table = ACPI_PTR(cros_ec_i2c_acpi_id),
.of_match_table = of_match_ptr(cros_ec_i2c_of_match),
- .pm = &cros_ec_i2c_pm_ops,
+ .pm = pm_sleep_ptr(&cros_ec_i2c_pm_ops),
},
.probe = cros_ec_i2c_probe,
.remove = cros_ec_i2c_remove,
diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index d6306d2a096f13..91b4f9dad069b1 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -504,7 +504,6 @@ static const struct dmi_system_id cros_ec_lpc_dmi_table[] __initconst = {
};
MODULE_DEVICE_TABLE(dmi, cros_ec_lpc_dmi_table);

-#ifdef CONFIG_PM_SLEEP
static int cros_ec_lpc_suspend(struct device *dev)
{
struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
@@ -518,17 +517,16 @@ static int cros_ec_lpc_resume(struct device *dev)

return cros_ec_resume(ec_dev);
}
-#endif

static const struct dev_pm_ops cros_ec_lpc_pm_ops = {
- SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_lpc_suspend, cros_ec_lpc_resume)
+ LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_lpc_suspend, cros_ec_lpc_resume)
};

static struct platform_driver cros_ec_lpc_driver = {
.driver = {
.name = DRV_NAME,
.acpi_match_table = cros_ec_lpc_acpi_device_ids,
- .pm = &cros_ec_lpc_pm_ops,
+ .pm = pm_sleep_ptr(&cros_ec_lpc_pm_ops),
},
.probe = cros_ec_lpc_probe,
.remove = cros_ec_lpc_remove,
--
2.34.1.448.ga2b2bfdf31-goog
\
 
 \ /
  Last update: 2022-01-04 07:22    [W:0.042 / U:1.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site