Skip to content

Commit

Permalink
media: mediatek: vcodec: add remove function for decoder platform driver
Browse files Browse the repository at this point in the history
[ Upstream commit e2a10b3 ]

Need to disable decoder power when remove decoder hardware driver, adding
remove callback function in the definition of platform driver.

Fixes: c05bada ("media: mtk-vcodec: Add to support multi hardware decode")
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
yunfei-mtk authored and gregkh committed May 11, 2023
1 parent 34fe290 commit c21717e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,16 @@ static int mtk_vdec_hw_probe(struct platform_device *pdev)
return ret;
}

static int mtk_vdec_hw_remove(struct platform_device *pdev)
{
pm_runtime_disable(&pdev->dev);

return 0;
}

static struct platform_driver mtk_vdec_driver = {
.probe = mtk_vdec_hw_probe,
.remove = mtk_vdec_hw_remove,
.driver = {
.name = "mtk-vdec-comp",
.of_match_table = mtk_vdec_hw_match,
Expand Down

0 comments on commit c21717e

Please sign in to comment.