aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-06-21 21:27:12 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-07-18 18:48:19 +0100
commit9ec91dd4e9444ead21cc07a9b7a99a9e96a47801 (patch)
tree3756f553f931abe46a3abcb806b26276c8ebaf09 /drivers/iio
parentiio: light: gp2ap002: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr() (diff)
downloadlinux-dev-9ec91dd4e9444ead21cc07a9b7a99a9e96a47801.tar.xz
linux-dev-9ec91dd4e9444ead21cc07a9b7a99a9e96a47801.zip
iio: light: isl29028: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()
Using these new macros allows removal of unused pm_ops structure and functions if !CONFIG_PM without the need to mark the functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Brian Masney <masneyb@onstation.org> Reviewed-by: Brian Masney <masneyb@onstation.org> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-30-jic23@kernel.org
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/light/isl29028.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/iio/light/isl29028.c b/drivers/iio/light/isl29028.c
index 720fa83d44e0..4dde9707a52d 100644
--- a/drivers/iio/light/isl29028.c
+++ b/drivers/iio/light/isl29028.c
@@ -651,7 +651,7 @@ static int isl29028_remove(struct i2c_client *client)
return 0;
}
-static int __maybe_unused isl29028_suspend(struct device *dev)
+static int isl29028_suspend(struct device *dev)
{
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
struct isl29028_chip *chip = iio_priv(indio_dev);
@@ -666,7 +666,7 @@ static int __maybe_unused isl29028_suspend(struct device *dev)
return ret;
}
-static int __maybe_unused isl29028_resume(struct device *dev)
+static int isl29028_resume(struct device *dev)
{
/**
* The specific component (ALS/IR or proximity) will enable itself as
@@ -676,11 +676,8 @@ static int __maybe_unused isl29028_resume(struct device *dev)
return 0;
}
-static const struct dev_pm_ops isl29028_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
- pm_runtime_force_resume)
- SET_RUNTIME_PM_OPS(isl29028_suspend, isl29028_resume, NULL)
-};
+static DEFINE_RUNTIME_DEV_PM_OPS(isl29028_pm_ops, isl29028_suspend,
+ isl29028_resume, NULL);
static const struct i2c_device_id isl29028_id[] = {
{"isl29028", 0},
@@ -700,7 +697,7 @@ MODULE_DEVICE_TABLE(of, isl29028_of_match);
static struct i2c_driver isl29028_driver = {
.driver = {
.name = "isl29028",
- .pm = &isl29028_pm_ops,
+ .pm = pm_ptr(&isl29028_pm_ops),
.of_match_table = isl29028_of_match,
},
.probe = isl29028_probe,