summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/tmp103.c
diff options
context:
space:
mode:
authorRahul Bedarkar <rahulbedarkar89@gmail.com>2017-04-23 19:40:51 +0530
committerGuenter Roeck <linux@roeck-us.net>2017-04-24 06:30:41 -0700
commit39c382a3109400f5abb5adc2040510e75f93b4cb (patch)
treeae55dbd039beac9b24cc60185b557318c6b45a56 /drivers/hwmon/tmp103.c
parent4abdf38d206fdc22f7a3f7bf79eef78734ec84ab (diff)
downloadop-kernel-dev-39c382a3109400f5abb5adc2040510e75f93b4cb.zip
op-kernel-dev-39c382a3109400f5abb5adc2040510e75f93b4cb.tar.gz
hwmon: (tmp103) Use SIMPLE_DEV_PM_OPS helper macro
Replace ifdefs with SIMPLE_DEV_PM_OPS helper macro. Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com> Acked-by: Heiko Schocher <hs@denx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/tmp103.c')
-rw-r--r--drivers/hwmon/tmp103.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/hwmon/tmp103.c b/drivers/hwmon/tmp103.c
index d0bb28b..7f85b14 100644
--- a/drivers/hwmon/tmp103.c
+++ b/drivers/hwmon/tmp103.c
@@ -150,8 +150,7 @@ static int tmp103_probe(struct i2c_client *client,
return PTR_ERR_OR_ZERO(hwmon_dev);
}
-#ifdef CONFIG_PM
-static int tmp103_suspend(struct device *dev)
+static int __maybe_unused tmp103_suspend(struct device *dev)
{
struct regmap *regmap = dev_get_drvdata(dev);
@@ -159,7 +158,7 @@ static int tmp103_suspend(struct device *dev)
TMP103_CONF_SD_MASK, 0);
}
-static int tmp103_resume(struct device *dev)
+static int __maybe_unused tmp103_resume(struct device *dev)
{
struct regmap *regmap = dev_get_drvdata(dev);
@@ -167,15 +166,7 @@ static int tmp103_resume(struct device *dev)
TMP103_CONF_SD_MASK, TMP103_CONF_SD);
}
-static const struct dev_pm_ops tmp103_dev_pm_ops = {
- .suspend = tmp103_suspend,
- .resume = tmp103_resume,
-};
-
-#define TMP103_DEV_PM_OPS (&tmp103_dev_pm_ops)
-#else
-#define TMP103_DEV_PM_OPS NULL
-#endif /* CONFIG_PM */
+static SIMPLE_DEV_PM_OPS(tmp103_dev_pm_ops, tmp103_suspend, tmp103_resume);
static const struct i2c_device_id tmp103_id[] = {
{ "tmp103", 0 },
@@ -193,7 +184,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 = &tmp103_dev_pm_ops,
},
.probe = tmp103_probe,
.id_table = tmp103_id,
OpenPOWER on IntegriCloud