aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-09-25 18:27:56 +0100
committerGuenter Roeck <linux@roeck-us.net>2022-09-25 14:22:12 -0700
commita158b4ea194a3a0232fcfac723ac5923a01bfa1a (patch)
tree81780d901fe3aada05f24134d8d902c8bc8cc054 /drivers/hwmon
parenthwmon: (tmp102) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() (diff)
downloadwireguard-linux-a158b4ea194a3a0232fcfac723ac5923a01bfa1a.tar.xz
wireguard-linux-a158b4ea194a3a0232fcfac723ac5923a01bfa1a.zip
hwmon: (tmp103) 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> Link: https://lore.kernel.org/r/20220925172759.3573439-16-jic23@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/tmp103.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hwmon/tmp103.c b/drivers/hwmon/tmp103.c
index 5cab4436aa77..56d5cbf36a45 100644
--- a/drivers/hwmon/tmp103.c
+++ b/drivers/hwmon/tmp103.c
@@ -178,7 +178,7 @@ static int tmp103_probe(struct i2c_client *client)
return PTR_ERR_OR_ZERO(hwmon_dev);
}
-static int __maybe_unused tmp103_suspend(struct device *dev)
+static int tmp103_suspend(struct device *dev)
{
struct regmap *regmap = dev_get_drvdata(dev);
@@ -186,7 +186,7 @@ static int __maybe_unused tmp103_suspend(struct device *dev)
TMP103_CONF_SD_MASK, 0);
}
-static int __maybe_unused tmp103_resume(struct device *dev)
+static int tmp103_resume(struct device *dev)
{
struct regmap *regmap = dev_get_drvdata(dev);
@@ -194,7 +194,7 @@ static int __maybe_unused tmp103_resume(struct device *dev)
TMP103_CONF_SD_MASK, TMP103_CONF_SD);
}
-static SIMPLE_DEV_PM_OPS(tmp103_dev_pm_ops, tmp103_suspend, tmp103_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(tmp103_dev_pm_ops, tmp103_suspend, tmp103_resume);
static const struct i2c_device_id tmp103_id[] = {
{ "tmp103", 0 },
@@ -212,7 +212,7 @@ static struct i2c_driver tmp103_driver = {
.driver = {
.name = "tmp103",
.of_match_table = of_match_ptr(tmp103_of_match),
- .pm = &tmp103_dev_pm_ops,
+ .pm = pm_sleep_ptr(&tmp103_dev_pm_ops),
},
.probe_new = tmp103_probe,
.id_table = tmp103_id,