iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Mon, 12 Apr 2021 05:32:02 +0000 (13:32 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:40:32 +0000 (10:40 +0200)
commit2b205f919bb4c0fadd9df12ad743f7d3b59fd72d
treef585c0bcf5c36f719ddf3dbfa4e536b280cd17fe
parentd4224ea9e07ea79b570848a0b560fc10d734e313
iio: proximity: pulsedlight: Fix rumtime PM imbalance on error

[ Upstream commit a2fa9242e89f27696515699fe0f0296bf1ac1815 ]

When lidar_write_control() fails, a pairing PM usage counter
decrement is needed to keep the counter balanced.

Fixes: 4ac4e086fd8c5 ("iio: pulsedlight-lidar-lite: add runtime PM")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210412053204.4889-1-dinghao.liu@zju.edu.cn
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c