Commit 60e91535 authored by Helen Koike's avatar Helen Koike Committed by Mauro Carvalho Chehab

media: staging: rkisp1: cap: fix return values from pm functions

If no errors occurs, pm functions return usage counters, so they can
return positive numbers.
This happens when streaming from multiple capture devices (mainpath and
selfpath).

Fix simultaneous streaming from mainpath and selfpath by not failing
when pm usage counters returns a positive number.
Signed-off-by: default avatarHelen Koike <helen.koike@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent b2b1046f
...@@ -892,7 +892,7 @@ static void rkisp1_vb2_stop_streaming(struct vb2_queue *queue) ...@@ -892,7 +892,7 @@ static void rkisp1_vb2_stop_streaming(struct vb2_queue *queue)
v4l2_pipeline_pm_put(&node->vdev.entity); v4l2_pipeline_pm_put(&node->vdev.entity);
ret = pm_runtime_put(rkisp1->dev); ret = pm_runtime_put(rkisp1->dev);
if (ret) if (ret < 0)
dev_err(rkisp1->dev, "power down failed error:%d\n", ret); dev_err(rkisp1->dev, "power down failed error:%d\n", ret);
rkisp1_dummy_buf_destroy(cap); rkisp1_dummy_buf_destroy(cap);
...@@ -945,7 +945,7 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count) ...@@ -945,7 +945,7 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count)
goto err_ret_buffers; goto err_ret_buffers;
ret = pm_runtime_get_sync(cap->rkisp1->dev); ret = pm_runtime_get_sync(cap->rkisp1->dev);
if (ret) { if (ret < 0) {
dev_err(cap->rkisp1->dev, "power up failed %d\n", ret); dev_err(cap->rkisp1->dev, "power up failed %d\n", ret);
goto err_destroy_dummy; goto err_destroy_dummy;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment