summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-06-21 21:26:59 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-07-18 18:48:18 +0100
commitfa55750642d0f4efc2c679ce4c41edf3a5389c9f (patch)
treed00830a3464cebb05617c455a424961586463b2c /drivers/iio
parentbf19b23591afa929f51b861a6c470a9a436df620 (diff)
downloadlinux-stable-fa55750642d0f4efc2c679ce4c41edf3a5389c9f.tar.gz
linux-stable-fa55750642d0f4efc2c679ce4c41edf3a5389c9f.tar.bz2
linux-stable-fa55750642d0f4efc2c679ce4c41edf3a5389c9f.zip
iio: gyro: itg3200: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-17-jic23@kernel.org
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/gyro/itg3200_core.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/iio/gyro/itg3200_core.c b/drivers/iio/gyro/itg3200_core.c
index a7f1bbb5f289..0491c64e1b32 100644
--- a/drivers/iio/gyro/itg3200_core.c
+++ b/drivers/iio/gyro/itg3200_core.c
@@ -364,7 +364,7 @@ static int itg3200_remove(struct i2c_client *client)
return 0;
}
-static int __maybe_unused itg3200_suspend(struct device *dev)
+static int itg3200_suspend(struct device *dev)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct itg3200 *st = iio_priv(indio_dev);
@@ -375,14 +375,15 @@ static int __maybe_unused itg3200_suspend(struct device *dev)
ITG3200_SLEEP);
}
-static int __maybe_unused itg3200_resume(struct device *dev)
+static int itg3200_resume(struct device *dev)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
return itg3200_initial_setup(indio_dev);
}
-static SIMPLE_DEV_PM_OPS(itg3200_pm_ops, itg3200_suspend, itg3200_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(itg3200_pm_ops, itg3200_suspend,
+ itg3200_resume);
static const struct i2c_device_id itg3200_id[] = {
{ "itg3200", 0 },
@@ -400,7 +401,7 @@ static struct i2c_driver itg3200_driver = {
.driver = {
.name = "itg3200",
.of_match_table = itg3200_of_match,
- .pm = &itg3200_pm_ops,
+ .pm = pm_sleep_ptr(&itg3200_pm_ops),
},
.id_table = itg3200_id,
.probe = itg3200_probe,