media: marvel-ccic: fix some issues when getting pm_runtime
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 23 Apr 2021 14:54:25 +0000 (16:54 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 10 May 2021 09:36:33 +0000 (11:36 +0200)
commite7c617cab7a522fba5b20f9033ee98565b6f3546
treefe793671bc6b0bcb82dab923ebdb4e6cca30b4fe
parent892bb6ecead9b834ba7ad1d07513e9eba1baa3a4
media: marvel-ccic: fix some issues when getting pm_runtime

Calling pm_runtime_get_sync() is bad, since even when it
returns an error, pm_runtime_put*() should be called.
So, use instead pm_runtime_resume_and_get().

While here, ensure that the error condition will be checked
during clock enable an media open() calls.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/marvell-ccic/mcam-core.c