Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95101947 authored by Hugues Fruchet's avatar Hugues Fruchet Committed by Greg Kroah-Hartman
Browse files

media: stm32-dcmi: fix check of pm_runtime_get_sync return value



commit ab41b99e7e55c85f29ff7b54718ccbbe051905e7 upstream.

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: default avatarHugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e7455065
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -584,9 +584,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;
	}