From: Sakari Ailus Date: Fri, 11 Oct 2019 09:45:22 +0000 (+0200) Subject: media: smiapp: Put the device again if starting streaming fails X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=22ad4e05585cb50c486b05bdaa4b4a4686074ff7;p=linux.git media: smiapp: Put the device again if starting streaming fails If there was an error in starting streaming, put the runtime usage count of the device. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index 0dca8db21f65f..a80d7701b519d 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -1565,8 +1565,11 @@ static int smiapp_set_stream(struct v4l2_subdev *subdev, int enable) sensor->streaming = true; rval = smiapp_start_streaming(sensor); - if (rval < 0) + if (rval < 0) { sensor->streaming = false; + pm_runtime_mark_last_busy(&client->dev); + pm_runtime_put_autosuspend(&client->dev); + } return rval; }