media: platform: s3c-camif: Fix runtime PM imbalance on error
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Thu, 21 May 2020 13:29:33 +0000 (15:29 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 27 Sep 2020 08:50:56 +0000 (10:50 +0200)
commitdafa3605fe60d5a61239d670919b2a36e712481e
tree09b0aed41e4765d5d995aedf2fa551a6ac98a521
parentd912a1d9e9afe69c6066c1ceb6bfc09063074075
media: platform: s3c-camif: Fix runtime PM imbalance on error

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.

Also, call pm_runtime_disable() when pm_runtime_get_sync() returns
an error code.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Sylwester Nawrocki <snawrocki@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/s3c-camif/camif-core.c