summaryrefslogtreecommitdiff
path: root/drivers/hwmon/ina3221.c
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-09-25 18:27:59 +0100
committerGuenter Roeck <linux@roeck-us.net>2022-09-25 14:22:12 -0700
commit2d5604c822e91c3eebaa0f9d0691acb954071ef1 (patch)
treeec272cc04ee8d7678cd2f0af0f1c497a2199b365 /drivers/hwmon/ina3221.c
parent655231d4b958cfe80f92ff8ae5c2d80d125b3c24 (diff)
hwmon: (ina3221) Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()
These new macros allow the compiler to see all the functions even if !CONFIG_PM* and remove the structures and functions if unused. This removes the need for __maybe_unused markings. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Ninad Malwade <nmalwade@nvidia.com> Link: https://lore.kernel.org/r/20220925172759.3573439-19-jic23@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/ina3221.c')
-rw-r--r--drivers/hwmon/ina3221.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c
index 58d3828e2ec0..8ef2631fc312 100644
--- a/drivers/hwmon/ina3221.c
+++ b/drivers/hwmon/ina3221.c
@@ -930,7 +930,7 @@ static int ina3221_remove(struct i2c_client *client)
return 0;
}
-static int __maybe_unused ina3221_suspend(struct device *dev)
+static int ina3221_suspend(struct device *dev)
{
struct ina3221_data *ina = dev_get_drvdata(dev);
int ret;
@@ -953,7 +953,7 @@ static int __maybe_unused ina3221_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused ina3221_resume(struct device *dev)
+static int ina3221_resume(struct device *dev)
{
struct ina3221_data *ina = dev_get_drvdata(dev);
int ret;
@@ -996,11 +996,8 @@ static int __maybe_unused ina3221_resume(struct device *dev)
return 0;
}
-static const struct dev_pm_ops ina3221_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
- pm_runtime_force_resume)
- SET_RUNTIME_PM_OPS(ina3221_suspend, ina3221_resume, NULL)
-};
+static DEFINE_RUNTIME_DEV_PM_OPS(ina3221_pm, ina3221_suspend, ina3221_resume,
+ NULL);
static const struct of_device_id ina3221_of_match_table[] = {
{ .compatible = "ti,ina3221", },
@@ -1020,7 +1017,7 @@ static struct i2c_driver ina3221_i2c_driver = {
.driver = {
.name = INA3221_DRIVER_NAME,
.of_match_table = ina3221_of_match_table,
- .pm = &ina3221_pm,
+ .pm = pm_ptr(&ina3221_pm),
},
.id_table = ina3221_ids,
};