iio: gyro: fxas21002c: balance runtime power in error path
authorRui Miguel Silva <rui.silva@linaro.org>
Wed, 12 May 2021 22:39:29 +0000 (23:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 07:00:32 +0000 (09:00 +0200)
commit619289733df016526738a3d2d646b7afd31cd975
tree49e6a8102ac8b654c4fd2cf1072b6bd2b15911a6
parent0239a3746332802073c618b20f4270d42defe462
iio: gyro: fxas21002c: balance runtime power in error path

commit 2a54c8c9ebc2006bf72554afc84ffc67768979a0 upstream.

If we fail to read temperature or axis we need to decrement the
runtime pm reference count to trigger autosuspend.

Add the call to pm_put to do that in case of error.

Fixes: a0701b6263ae ("iio: gyro: add core driver for fxas21002c")
Suggested-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/linux-iio/CBBZA9T1OY9C.2611WSV49DV2G@arch-thunder/
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/gyro/fxas21002c_core.c