summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-09-25 19:27:48 +0200
committerGuenter Roeck <linux@roeck-us.net>2022-09-25 23:22:12 +0200
commitd025007daaef3e468021c998e1de3f9bf3ba3476 (patch)
treef8c8d723ce8f969a87267adc0ea2e6043d5e75a7 /drivers/hwmon
parenthwmon: (it87) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() (diff)
downloadlinux-d025007daaef3e468021c998e1de3f9bf3ba3476.tar.xz
linux-d025007daaef3e468021c998e1de3f9bf3ba3476.zip
hwmon: (lm90) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20220925172759.3573439-8-jic23@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/lm90.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index c151c0bf43f2..db595f7d01f8 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -2956,7 +2956,7 @@ static void lm90_alert(struct i2c_client *client, enum i2c_alert_protocol type,
}
}
-static int __maybe_unused lm90_suspend(struct device *dev)
+static int lm90_suspend(struct device *dev)
{
struct lm90_data *data = dev_get_drvdata(dev);
struct i2c_client *client = data->client;
@@ -2967,7 +2967,7 @@ static int __maybe_unused lm90_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused lm90_resume(struct device *dev)
+static int lm90_resume(struct device *dev)
{
struct lm90_data *data = dev_get_drvdata(dev);
struct i2c_client *client = data->client;
@@ -2978,14 +2978,14 @@ static int __maybe_unused lm90_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(lm90_pm_ops, lm90_suspend, lm90_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(lm90_pm_ops, lm90_suspend, lm90_resume);
static struct i2c_driver lm90_driver = {
.class = I2C_CLASS_HWMON,
.driver = {
.name = "lm90",
.of_match_table = of_match_ptr(lm90_of_match),
- .pm = &lm90_pm_ops,
+ .pm = pm_sleep_ptr(&lm90_pm_ops),
},
.probe_new = lm90_probe,
.alert = lm90_alert,