Skip to content

Commit a2d2e59

Browse files
nfrapradomchehab
authored andcommitted
media: mediatek: vcodec: Drop platform_get_resource(IORESOURCE_IRQ)
Commit a1a2b71 ("of/platform: Drop static setup of IRQ resource from DT core") removed support for calling platform_get_resource(..., IORESOURCE_IRQ, ...) on DT-based drivers, but the probe() function of mtk-vcodec's encoder was still making use of it. This caused the encoder driver to fail probe. Since the platform_get_resource() call was only being used to check for the presence of the interrupt (its returned resource wasn't even used) and platform_get_irq() was already being used to get the IRQ, simply drop the use of platform_get_resource(IORESOURCE_IRQ) and handle the failure of platform_get_irq(), to get the driver probing again. [hverkuil: drop unused struct resource *res] Fixes: a1a2b71 ("of/platform: Drop static setup of IRQ resource from DT core") Signed-off-by: Nícolas F. R. A. Prado <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 3723869 commit a2d2e59

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
228228
{
229229
struct mtk_vcodec_dev *dev;
230230
struct video_device *vfd_enc;
231-
struct resource *res;
232231
phandle rproc_phandle;
233232
enum mtk_vcodec_fw_type fw_type;
234233
int ret;
@@ -272,14 +271,12 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
272271
goto err_res;
273272
}
274273

275-
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
276-
if (res == NULL) {
277-
dev_err(&pdev->dev, "failed to get irq resource");
278-
ret = -ENOENT;
274+
dev->enc_irq = platform_get_irq(pdev, 0);
275+
if (dev->enc_irq < 0) {
276+
ret = dev->enc_irq;
279277
goto err_res;
280278
}
281279

282-
dev->enc_irq = platform_get_irq(pdev, 0);
283280
irq_set_status_flags(dev->enc_irq, IRQ_NOAUTOEN);
284281
ret = devm_request_irq(&pdev->dev, dev->enc_irq,
285282
mtk_vcodec_enc_irq_handler,

0 commit comments

Comments
 (0)