Skip to content

Commit a158b4e

Browse files
jic23groeck
authored andcommitted
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>
1 parent 73568f9 commit a158b4e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/hwmon/tmp103.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,23 +178,23 @@ static int tmp103_probe(struct i2c_client *client)
178178
return PTR_ERR_OR_ZERO(hwmon_dev);
179179
}
180180

181-
static int __maybe_unused tmp103_suspend(struct device *dev)
181+
static int tmp103_suspend(struct device *dev)
182182
{
183183
struct regmap *regmap = dev_get_drvdata(dev);
184184

185185
return regmap_update_bits(regmap, TMP103_CONF_REG,
186186
TMP103_CONF_SD_MASK, 0);
187187
}
188188

189-
static int __maybe_unused tmp103_resume(struct device *dev)
189+
static int tmp103_resume(struct device *dev)
190190
{
191191
struct regmap *regmap = dev_get_drvdata(dev);
192192

193193
return regmap_update_bits(regmap, TMP103_CONF_REG,
194194
TMP103_CONF_SD_MASK, TMP103_CONF_SD);
195195
}
196196

197-
static SIMPLE_DEV_PM_OPS(tmp103_dev_pm_ops, tmp103_suspend, tmp103_resume);
197+
static DEFINE_SIMPLE_DEV_PM_OPS(tmp103_dev_pm_ops, tmp103_suspend, tmp103_resume);
198198

199199
static const struct i2c_device_id tmp103_id[] = {
200200
{ "tmp103", 0 },
@@ -212,7 +212,7 @@ static struct i2c_driver tmp103_driver = {
212212
.driver = {
213213
.name = "tmp103",
214214
.of_match_table = of_match_ptr(tmp103_of_match),
215-
.pm = &tmp103_dev_pm_ops,
215+
.pm = pm_sleep_ptr(&tmp103_dev_pm_ops),
216216
},
217217
.probe_new = tmp103_probe,
218218
.id_table = tmp103_id,

0 commit comments

Comments
 (0)