Skip to content

Commit

Permalink
iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
Browse files Browse the repository at this point in the history
[ Upstream commit a2fa924 ]

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

Fixes: 4ac4e08 ("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>
  • Loading branch information
dinghaoliu authored and gregkh committed May 19, 2021
1 parent e317435 commit 37b2153
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg)
ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE);
if (ret < 0) {
dev_err(&client->dev, "cannot send start measurement command");
pm_runtime_put_noidle(&client->dev);
return ret;
}

Expand Down

0 comments on commit 37b2153

Please sign in to comment.