Skip to content

Commit a2fa924

Browse files
dinghaoliujic23
authored andcommitted
iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
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 <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 8edb79a commit a2fa924

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/iio/proximity/pulsedlight-lidar-lite-v2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg)
160160
ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE);
161161
if (ret < 0) {
162162
dev_err(&client->dev, "cannot send start measurement command");
163+
pm_runtime_put_noidle(&client->dev);
163164
return ret;
164165
}
165166

0 commit comments

Comments
 (0)