diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-01-30 19:31:45 +0000 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-02-21 19:33:04 +0000 |
commit | 05a9ddc8fc54e416939badec1cb2969917187812 (patch) | |
tree | eda1b1ba3476908a07acd3fe405c17d876739152 /drivers/iio/chemical/atlas-sensor.c | |
parent | ae73d91e60056ef913d583f5796f9dac9ae54482 (diff) | |
download | linux-stable-05a9ddc8fc54e416939badec1cb2969917187812.tar.gz linux-stable-05a9ddc8fc54e416939badec1cb2969917187812.tar.bz2 linux-stable-05a9ddc8fc54e416939badec1cb2969917187812.zip |
iio:chemical:atlas: Switch from CONFIG_PM guards to pm_ptr() etc
Letting the compiler remove these functions when the kernel is built
without CONFIG_PM support is simpler and less error prone than the
use of #ifdef based config guards.
Removing instances of this approach from IIO also stops them being
copied into new drivers.
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-49-jic23@kernel.org
Diffstat (limited to 'drivers/iio/chemical/atlas-sensor.c')
-rw-r--r-- | drivers/iio/chemical/atlas-sensor.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c index a8211dd20b35..56dea9734c8d 100644 --- a/drivers/iio/chemical/atlas-sensor.c +++ b/drivers/iio/chemical/atlas-sensor.c @@ -737,7 +737,6 @@ static int atlas_remove(struct i2c_client *client) return atlas_set_powermode(data, 0); } -#ifdef CONFIG_PM static int atlas_runtime_suspend(struct device *dev) { struct atlas_data *data = @@ -753,18 +752,16 @@ static int atlas_runtime_resume(struct device *dev) return atlas_set_powermode(data, 1); } -#endif static const struct dev_pm_ops atlas_pm_ops = { - SET_RUNTIME_PM_OPS(atlas_runtime_suspend, - atlas_runtime_resume, NULL) + RUNTIME_PM_OPS(atlas_runtime_suspend, atlas_runtime_resume, NULL) }; static struct i2c_driver atlas_driver = { .driver = { .name = ATLAS_DRV_NAME, .of_match_table = atlas_dt_ids, - .pm = &atlas_pm_ops, + .pm = pm_ptr(&atlas_pm_ops), }, .probe = atlas_probe, .remove = atlas_remove, |