linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] media: platform: ti: fix the return value handle for platform_get_irq()
@ 2023-07-31 12:02 Ruan Jinjie
  2023-08-02 21:04 ` Laurent Pinchart
  2023-08-03 13:40 ` Lad, Prabhakar
  0 siblings, 2 replies; 4+ messages in thread
From: Ruan Jinjie @ 2023-07-31 12:02 UTC (permalink / raw)
  To: prabhakar.csengg, mchehab, laurent.pinchart, linux-media; +Cc: ruanjinjie

There is no possible for platform_get_irq() to return 0,
and the return value of platform_get_irq() is more sensible
to show the error reason.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
 drivers/media/platform/ti/am437x/am437x-vpfe.c | 4 +---
 drivers/media/platform/ti/omap3isp/isp.c       | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c
index 81a63a3865cf..a85b97107de7 100644
--- a/drivers/media/platform/ti/am437x/am437x-vpfe.c
+++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c
@@ -2420,10 +2420,8 @@ static int vpfe_probe(struct platform_device *pdev)
 	}
 
 	ret = platform_get_irq(pdev, 0);
-	if (ret <= 0) {
-		ret = -ENODEV;
+	if (ret < 0)
 		goto probe_out_cleanup;
-	}
 	vpfe->irq = ret;
 
 	ret = devm_request_irq(vpfe->pdev, vpfe->irq, vpfe_isr, 0,
diff --git a/drivers/media/platform/ti/omap3isp/isp.c b/drivers/media/platform/ti/omap3isp/isp.c
index f3aaa9e76492..226db75221cd 100644
--- a/drivers/media/platform/ti/omap3isp/isp.c
+++ b/drivers/media/platform/ti/omap3isp/isp.c
@@ -2398,10 +2398,8 @@ static int isp_probe(struct platform_device *pdev)
 
 	/* Interrupt */
 	ret = platform_get_irq(pdev, 0);
-	if (ret <= 0) {
-		ret = -ENODEV;
+	if (ret < 0)
 		goto error_iommu;
-	}
 	isp->irq_num = ret;
 
 	if (devm_request_irq(isp->dev, isp->irq_num, isp_isr, IRQF_SHARED,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] media: platform: ti: fix the return value handle for platform_get_irq()
  2023-07-31 12:02 [PATCH -next] media: platform: ti: fix the return value handle for platform_get_irq() Ruan Jinjie
@ 2023-08-02 21:04 ` Laurent Pinchart
  2023-08-03 10:20   ` Sakari Ailus
  2023-08-03 13:40 ` Lad, Prabhakar
  1 sibling, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2023-08-02 21:04 UTC (permalink / raw)
  To: Ruan Jinjie; +Cc: prabhakar.csengg, mchehab, linux-media, Sakari Ailus

Hi Ruan,

Thank you for the patch.

On Mon, Jul 31, 2023 at 08:02:12PM +0800, Ruan Jinjie wrote:
> There is no possible for platform_get_irq() to return 0,
> and the return value of platform_get_irq() is more sensible
> to show the error reason.
> 
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> ---
>  drivers/media/platform/ti/am437x/am437x-vpfe.c | 4 +---
>  drivers/media/platform/ti/omap3isp/isp.c       | 4 +---
>  2 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c
> index 81a63a3865cf..a85b97107de7 100644
> --- a/drivers/media/platform/ti/am437x/am437x-vpfe.c
> +++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c
> @@ -2420,10 +2420,8 @@ static int vpfe_probe(struct platform_device *pdev)
>  	}
>  
>  	ret = platform_get_irq(pdev, 0);
> -	if (ret <= 0) {
> -		ret = -ENODEV;
> +	if (ret < 0)
>  		goto probe_out_cleanup;
> -	}
>  	vpfe->irq = ret;
>  
>  	ret = devm_request_irq(vpfe->pdev, vpfe->irq, vpfe_isr, 0,
> diff --git a/drivers/media/platform/ti/omap3isp/isp.c b/drivers/media/platform/ti/omap3isp/isp.c
> index f3aaa9e76492..226db75221cd 100644
> --- a/drivers/media/platform/ti/omap3isp/isp.c
> +++ b/drivers/media/platform/ti/omap3isp/isp.c
> @@ -2398,10 +2398,8 @@ static int isp_probe(struct platform_device *pdev)
>  
>  	/* Interrupt */
>  	ret = platform_get_irq(pdev, 0);
> -	if (ret <= 0) {
> -		ret = -ENODEV;
> +	if (ret < 0)
>  		goto error_iommu;
> -	}
>  	isp->irq_num = ret;
>  
>  	if (devm_request_irq(isp->dev, isp->irq_num, isp_isr, IRQF_SHARED,

The changes look fine to me.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Sakari, would you like to merge this through your tree ?

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] media: platform: ti: fix the return value handle for platform_get_irq()
  2023-08-02 21:04 ` Laurent Pinchart
@ 2023-08-03 10:20   ` Sakari Ailus
  0 siblings, 0 replies; 4+ messages in thread
From: Sakari Ailus @ 2023-08-03 10:20 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Ruan Jinjie, prabhakar.csengg, mchehab, linux-media

On Thu, Aug 03, 2023 at 12:04:44AM +0300, Laurent Pinchart wrote:
> Hi Ruan,
> 
> Thank you for the patch.
> 
> On Mon, Jul 31, 2023 at 08:02:12PM +0800, Ruan Jinjie wrote:
> > There is no possible for platform_get_irq() to return 0,
> > and the return value of platform_get_irq() is more sensible
> > to show the error reason.
> > 
> > Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> > ---
> >  drivers/media/platform/ti/am437x/am437x-vpfe.c | 4 +---
> >  drivers/media/platform/ti/omap3isp/isp.c       | 4 +---
> >  2 files changed, 2 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c
> > index 81a63a3865cf..a85b97107de7 100644
> > --- a/drivers/media/platform/ti/am437x/am437x-vpfe.c
> > +++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c
> > @@ -2420,10 +2420,8 @@ static int vpfe_probe(struct platform_device *pdev)
> >  	}
> >  
> >  	ret = platform_get_irq(pdev, 0);
> > -	if (ret <= 0) {
> > -		ret = -ENODEV;
> > +	if (ret < 0)
> >  		goto probe_out_cleanup;
> > -	}
> >  	vpfe->irq = ret;
> >  
> >  	ret = devm_request_irq(vpfe->pdev, vpfe->irq, vpfe_isr, 0,
> > diff --git a/drivers/media/platform/ti/omap3isp/isp.c b/drivers/media/platform/ti/omap3isp/isp.c
> > index f3aaa9e76492..226db75221cd 100644
> > --- a/drivers/media/platform/ti/omap3isp/isp.c
> > +++ b/drivers/media/platform/ti/omap3isp/isp.c
> > @@ -2398,10 +2398,8 @@ static int isp_probe(struct platform_device *pdev)
> >  
> >  	/* Interrupt */
> >  	ret = platform_get_irq(pdev, 0);
> > -	if (ret <= 0) {
> > -		ret = -ENODEV;
> > +	if (ret < 0)
> >  		goto error_iommu;
> > -	}
> >  	isp->irq_num = ret;
> >  
> >  	if (devm_request_irq(isp->dev, isp->irq_num, isp_isr, IRQF_SHARED,
> 
> The changes look fine to me.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Sakari, would you like to merge this through your tree ?

Done, thanks. I'll push it this afternoon to my git.linuxtv.org tree.

-- 
Sakari Ailus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] media: platform: ti: fix the return value handle for platform_get_irq()
  2023-07-31 12:02 [PATCH -next] media: platform: ti: fix the return value handle for platform_get_irq() Ruan Jinjie
  2023-08-02 21:04 ` Laurent Pinchart
@ 2023-08-03 13:40 ` Lad, Prabhakar
  1 sibling, 0 replies; 4+ messages in thread
From: Lad, Prabhakar @ 2023-08-03 13:40 UTC (permalink / raw)
  To: Ruan Jinjie; +Cc: mchehab, laurent.pinchart, linux-media

On Mon, Jul 31, 2023 at 1:02 PM Ruan Jinjie <ruanjinjie@huawei.com> wrote:
>
> There is no possible for platform_get_irq() to return 0,
> and the return value of platform_get_irq() is more sensible
> to show the error reason.
>
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> ---
>  drivers/media/platform/ti/am437x/am437x-vpfe.c | 4 +---
>  drivers/media/platform/ti/omap3isp/isp.c       | 4 +---
>  2 files changed, 2 insertions(+), 6 deletions(-)
>
Reviewed-by: Lad Prabhakar <prabhakar.csengg@gmail.com>

Cheers,
Prabhakar

> diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c
> index 81a63a3865cf..a85b97107de7 100644
> --- a/drivers/media/platform/ti/am437x/am437x-vpfe.c
> +++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c
> @@ -2420,10 +2420,8 @@ static int vpfe_probe(struct platform_device *pdev)
>         }
>
>         ret = platform_get_irq(pdev, 0);
> -       if (ret <= 0) {
> -               ret = -ENODEV;
> +       if (ret < 0)
>                 goto probe_out_cleanup;
> -       }
>         vpfe->irq = ret;
>
>         ret = devm_request_irq(vpfe->pdev, vpfe->irq, vpfe_isr, 0,
> diff --git a/drivers/media/platform/ti/omap3isp/isp.c b/drivers/media/platform/ti/omap3isp/isp.c
> index f3aaa9e76492..226db75221cd 100644
> --- a/drivers/media/platform/ti/omap3isp/isp.c
> +++ b/drivers/media/platform/ti/omap3isp/isp.c
> @@ -2398,10 +2398,8 @@ static int isp_probe(struct platform_device *pdev)
>
>         /* Interrupt */
>         ret = platform_get_irq(pdev, 0);
> -       if (ret <= 0) {
> -               ret = -ENODEV;
> +       if (ret < 0)
>                 goto error_iommu;
> -       }
>         isp->irq_num = ret;
>
>         if (devm_request_irq(isp->dev, isp->irq_num, isp_isr, IRQF_SHARED,
> --
> 2.34.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-03 13:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-31 12:02 [PATCH -next] media: platform: ti: fix the return value handle for platform_get_irq() Ruan Jinjie
2023-08-02 21:04 ` Laurent Pinchart
2023-08-03 10:20   ` Sakari Ailus
2023-08-03 13:40 ` Lad, Prabhakar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).