media: stm32-dcmi: fix check of pm_runtime_get_sync return value
authorHugues Fruchet <hugues.fruchet@st.com>
Thu, 28 Feb 2019 17:09:17 +0000 (12:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:21:34 +0000 (09:21 +0100)
commit9510194763e08f9823e1340e52ad3d9b44864f8e
tree128718a86a4391368c899b3bb3b48b3fca3cdcb0
parente7455065952b1b1c0a62db153ac5297eee97d48d
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: 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>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/stm32/stm32-dcmi.c