media: hantro: do a PM resume earlier
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 28 Apr 2021 06:27:55 +0000 (08:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:02 +0000 (16:56 +0200)
commit2c3164f31a4963d4b267cf5dc97a23103c4e056d
tree504d46e99ab1d77b67f573dcf3e08e0ba0f3fbcc
parent6efd8921eb8407b18ced6019add4d6e93ac46b01
media: hantro: do a PM resume earlier

[ Upstream commit 892bb6ecead9b834ba7ad1d07513e9eba1baa3a4 ]

The device_run() first enables the clock and then
tries to resume PM runtime, checking for errors.

Well, if for some reason the pm_runtime can not resume,
it would be better to detect it beforehand.

So, change the order inside device_run().

Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Fixes: 775fec69008d ("media: add Rockchip VPU JPEG encoder driver")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/hantro/hantro_drv.c