]> git.baikalelectronics.ru Git - kernel.git/commit
iio: pressure: icp10100: Balance runtime pm + use pm_runtime_resume_and_get()
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 16 May 2021 16:21:03 +0000 (17:21 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 16 Jun 2021 13:53:13 +0000 (14:53 +0100)
commit432d206a88f94a24c3d879d904c750d3096ed4de
treefb293b06a41a6d77fc925bdd7d0f58cf65d2b772
parent175f9c27a77bd7a0ed66121972c3d133ca09b921
iio: pressure: icp10100: Balance runtime pm + use pm_runtime_resume_and_get()

The devm_ handled runtime pm disable calls pm_runtime_put_sync_suspend()
which isn't balancing a matching get call.  It isn't a bug as such,
because the runtime pm core doesn't decrement the reference count below
zero, but it is missleading so let's drop it.

Using pm_runtime_resume_and_get() new call makes it easy to handle
failures in resume as it doesn't hold a reference count if it exits
with an error.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20210516162103.1332291-7-jic23@kernel.org
drivers/iio/pressure/icp10100.c