lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Tue, 8 Mar 2022 06:42:28 +0000 From: cgel.zte@...il.com To: prabhakar.csengg@...il.com Cc: mchehab@...nel.org, linux-media@...r.kernel.org, linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>, Zeal Robot <zealci@....com.cn> Subject: [PATCH] media: davinci: Use platform_get_irq() to get the interrupt From: Minghao Chi (CGEL ZTE) <chi.minghao@....com.cn> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Reported-by: Zeal Robot <zealci@....com.cn> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@....com.cn> --- drivers/media/platform/davinci/vpfe_capture.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index 0a2226b321d7..b3cafa16a1ad 100644 --- a/drivers/media/platform/davinci/vpfe_capture.c +++ b/drivers/media/platform/davinci/vpfe_capture.c @@ -1674,11 +1674,10 @@ static int vpfe_probe(struct platform_device *pdev) { struct vpfe_subdev_info *sdinfo; struct vpfe_config *vpfe_cfg; - struct resource *res1; struct vpfe_device *vpfe_dev; struct i2c_adapter *i2c_adap; struct video_device *vfd; - int ret, i, j; + int ret, i, j, irq; int num_subdevs = 0; /* Get the pointer to the device object */ @@ -1717,24 +1716,24 @@ static int vpfe_probe(struct platform_device *pdev) strscpy(ccdc_cfg->name, vpfe_cfg->ccdc, sizeof(ccdc_cfg->name)); /* Get VINT0 irq resource */ - res1 = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!res1) { + irq = platform_get_irq(pdev, 0); + if (irq < 0) { v4l2_err(pdev->dev.driver, "Unable to get interrupt for VINT0\n"); ret = -ENODEV; goto probe_free_ccdc_cfg_mem; } - vpfe_dev->ccdc_irq0 = res1->start; + vpfe_dev->ccdc_irq0 = irq; /* Get VINT1 irq resource */ - res1 = platform_get_resource(pdev, IORESOURCE_IRQ, 1); - if (!res1) { + irq = platform_get_irq(pdev, 1); + if (irq < 0) { v4l2_err(pdev->dev.driver, "Unable to get interrupt for VINT1\n"); ret = -ENODEV; goto probe_free_ccdc_cfg_mem; } - vpfe_dev->ccdc_irq1 = res1->start; + vpfe_dev->ccdc_irq1 = irq; ret = request_irq(vpfe_dev->ccdc_irq0, vpfe_isr, 0, "vpfe_capture0", vpfe_dev); -- 2.25.1
Powered by blists - more mailing lists