diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2019-10-11 11:45:22 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-01-03 16:38:06 +0100 |
commit | 22ad4e05585cb50c486b05bdaa4b4a4686074ff7 (patch) | |
tree | 2f189e2c0222cbbbcbd5ea81435a9244a32ba0ee /drivers/media/i2c | |
parent | media: smiapp: Avoid maintaining power state information (diff) | |
download | linux-22ad4e05585cb50c486b05bdaa4b4a4686074ff7.tar.xz linux-22ad4e05585cb50c486b05bdaa4b4a4686074ff7.zip |
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 <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/smiapp/smiapp-core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index 0dca8db21f65..a80d7701b519 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; } |