OSDN Git Service

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)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 19 Mar 2019 17:49:40 +0000 (13:49 -0400)
commitab41b99e7e55c85f29ff7b54718ccbbe051905e7
treea393bbf7e70f9a4a5dcf7c60857a398f59a1522c
parent2c2a8dc32cebb71e42cfc2ed1bd433cbec792207
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>
drivers/media/platform/stm32/stm32-dcmi.c