]> git.baikalelectronics.ru Git - kernel.git/commit
iio: proximity: srf04: Use pm_ptr() to remove unused struct dev_pm_ops
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 7 Aug 2022 18:56:16 +0000 (19:56 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 21 Sep 2022 17:42:56 +0000 (18:42 +0100)
commit177bfb13d7d28f482969d2e93426bd7c88581ea1
treebe4966ceb78d9d8a5eeae1f3ac69dd9bac788acf
parentd323dee4bf54442c4ddf56fb5e30758cacd82712
iio: proximity: srf04: Use pm_ptr() to remove unused struct dev_pm_ops

If CONFIG_PM is not set, the pm_ptr() will ensure that the struct
dev_pm_ops and callbacks are removed without the need for __maybe_unused
markings.

In this case we can't simply use DEFINE_RUNTIME_DEV_PM_OPS() because
that would provide suspend and resume functions without the
checks the driver is doing before calling runtime_pm functions
(whether the necessary GPIO is provided).  It may be possible to
clean that up in future by moving the checks into the callbacks.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Andreas Klinger <ak@it-klinger.de>
Link: https://lore.kernel.org/r/20220807185618.1038812-5-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/srf04.c