From: Ezequiel Garcia <ezequiel@collabora.com>
To: Jernej Skrabec <jernej.skrabec@gmail.com>, p.zabel@pengutronix.de
Cc: mchehab@kernel.org, gregkh@linuxfoundation.org,
hverkuil-cisco@xs4all.nl, emil.velikov@collabora.com,
linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: hantro: Fix check for single irq
Date: Thu, 05 Aug 2021 19:03:36 -0300 [thread overview]
Message-ID: <6761bb11f4554e9f9cbe468b5ff8f851c57515ef.camel@collabora.com> (raw)
In-Reply-To: <20210805190416.332563-1-jernej.skrabec@gmail.com>
Hi Jernej,
On Thu, 2021-08-05 at 21:04 +0200, Jernej Skrabec wrote:
> Some cores use only one interrupt and in such case interrupt name in DT
> is not needed. Driver supposedly accounted that, but due to the wrong
> field check it never worked. Fix that.
>
> Fixes: 18d6c8b7b4c9 ("media: hantro: add fallback handling for single irq/clk")
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> ---
> drivers/staging/media/hantro/hantro_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
> index 8a2edd67f2c6..20e508158871 100644
> --- a/drivers/staging/media/hantro/hantro_drv.c
> +++ b/drivers/staging/media/hantro/hantro_drv.c
> @@ -919,7 +919,7 @@ static int hantro_probe(struct platform_device *pdev)
> if (!vpu->variant->irqs[i].handler)
> continue;
>
> - if (vpu->variant->num_clocks > 1) {
> + if (vpu->variant->num_irqs > 1) {
Oops, thanks for spotting this.
How about this instead?
diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index 31d8449ca1d2..af7054b04155 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -918,16 +918,15 @@ static int hantro_probe(struct platform_device *pdev)
if (!vpu->variant->irqs[i].handler)
continue;
- if (vpu->variant->num_clocks > 1) {
- irq_name = vpu->variant->irqs[i].name;
- irq = platform_get_irq_byname(vpu->pdev, irq_name);
- } else {
+ irq_name = vpu->variant->irqs[i].name;
+ irq = platform_get_irq_byname(vpu->pdev, irq_name);
+ if (irq <= 0) {
/*
- * If the driver has a single IRQ, chances are there
- * will be no actual name in the DT bindings.
+ * Missing interrupt-names property in device tree,
+ * looking up interrupts by index.
*/
irq_name = "default";
- irq = platform_get_irq(vpu->pdev, 0);
+ irq = platform_get_irq(vpu->pdev, i);
}
if (irq <= 0)
return -ENXIO;
--
Kindly,
Ezequiel
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2021-08-05 22:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-05 19:04 [PATCH] media: hantro: Fix check for single irq Jernej Skrabec
2021-08-05 22:03 ` Ezequiel Garcia [this message]
2021-08-06 4:44 ` Jernej Škrabec
2021-08-06 14:13 ` Ezequiel Garcia
2021-08-06 15:39 ` Jernej Škrabec
2021-08-09 15:20 ` Emil Velikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6761bb11f4554e9f9cbe468b5ff8f851c57515ef.camel@collabora.com \
--to=ezequiel@collabora.com \
--cc=emil.velikov@collabora.com \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jernej.skrabec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox