diff options
author | Hugues Fruchet <hugues.fruchet@st.com> | 2019-02-28 18:09:17 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-03-19 18:49:40 +0100 |
commit | ab41b99e7e55c85f29ff7b54718ccbbe051905e7 (patch) | |
tree | a393bbf7e70f9a4a5dcf7c60857a398f59a1522c | |
parent | media: platform/sh_veu.c: remove redundant NULL pointer checks (diff) | |
download | linux-ab41b99e7e55c85f29ff7b54718ccbbe051905e7.tar.xz linux-ab41b99e7e55c85f29ff7b54718ccbbe051905e7.zip |
media: stm32-dcmi: fix check of pm_runtime_get_sync return value
Start streaming was sometimes failing because of pm_runtime_get_sync()
non-0 return value. In fact return value was not an error but a
positive value (1), indicating that PM was already enabled.
Fix this by going to error path only with negative return value.
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r-- | drivers/media/platform/stm32/stm32-dcmi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index 5fe5b38fa901..37e9fb08918a 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -570,9 +570,9 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count) int ret; ret = pm_runtime_get_sync(dcmi->dev); - if (ret) { - dev_err(dcmi->dev, "%s: Failed to start streaming, cannot get sync\n", - __func__); + if (ret < 0) { + dev_err(dcmi->dev, "%s: Failed to start streaming, cannot get sync (%d)\n", + __func__, ret); goto err_release_buffers; } |