media: mtk-vpu: Drop unnecessary call to platform_get_resource()

mtk_vpu_probe() calls platform_get_resource(pdev, IORESOURCE_IRQ, ..)
to check if IRQ resource exists and later calls
platform_get_irq(pdev, ..) to get the actual IRQ.

This patch drops an unnecessary call to platform_get_resource() and
checks the return value of platform_get_irq(pdev, ..) to make sure the
IRQ line is valid.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Lad Prabhakar 2022-01-11 01:23:13 +01:00 committed by Mauro Carvalho Chehab
parent d5e438902e
commit 3364c5260d

View File

@ -810,7 +810,6 @@ static int mtk_vpu_probe(struct platform_device *pdev)
{
struct mtk_vpu *vpu;
struct device *dev;
struct resource *res;
int ret = 0;
dev_dbg(&pdev->dev, "initialization\n");
@ -908,13 +907,10 @@ static int mtk_vpu_probe(struct platform_device *pdev)
init_waitqueue_head(&vpu->run.wq);
init_waitqueue_head(&vpu->ack_wq);
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res) {
dev_err(dev, "get IRQ resource failed.\n");
ret = -ENXIO;
ret = platform_get_irq(pdev, 0);
if (ret < 0)
goto free_p_mem;
}
vpu->reg.irq = platform_get_irq(pdev, 0);
vpu->reg.irq = ret;
ret = devm_request_irq(dev, vpu->reg.irq, vpu_irq_handler, 0,
pdev->name, vpu);
if (ret) {