linux-brain/drivers/media/platform/mtk-vcodec
Mauro Carvalho Chehab f1a8951cf1 media: mtk-vcodec: fix PM runtime get logic
[ Upstream commit 908711f542c17fe61e5d653da1beb8e5ab5c7b50 ]

Currently, the driver just assumes that PM runtime logic
succeded resuming the device.

That may not be the case, as pm_runtime_get_sync()
can fail (but keeping the usage count incremented).

Replace the code to use pm_runtime_resume_and_get(),
and letting it return the error code.

This way, if mtk_vcodec_dec_pw_on() fails, the logic
under fops_vcodec_open() will do the right thing and
return an error, instead of just assuming that the
device is ready to be used.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:53:09 +02:00
..
vdec
venc
Makefile
mtk_vcodec_dec.c
mtk_vcodec_dec.h
mtk_vcodec_dec_drv.c media: mtk-vcodec: fix PM runtime get logic 2021-07-14 16:53:09 +02:00
mtk_vcodec_dec_pm.c media: mtk-vcodec: fix PM runtime get logic 2021-07-14 16:53:09 +02:00
mtk_vcodec_dec_pm.h media: mtk-vcodec: fix PM runtime get logic 2021-07-14 16:53:09 +02:00
mtk_vcodec_drv.h
mtk_vcodec_enc.c
mtk_vcodec_enc.h
mtk_vcodec_enc_drv.c
mtk_vcodec_enc_pm.c media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_enc_pm() 2020-12-30 11:51:08 +01:00
mtk_vcodec_enc_pm.h
mtk_vcodec_intr.c
mtk_vcodec_intr.h
mtk_vcodec_util.c
mtk_vcodec_util.h
vdec_drv_base.h
vdec_drv_if.c
vdec_drv_if.h
vdec_ipi_msg.h
vdec_vpu_if.c
vdec_vpu_if.h
venc_drv_base.h
venc_drv_if.c
venc_drv_if.h
venc_ipi_msg.h
venc_vpu_if.c
venc_vpu_if.h