public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/panthor: Fix error code in panthor_gpu_init()
@ 2024-04-02  9:56 Dan Carpenter
  2024-04-02 12:20 ` Boris Brezillon
  2024-04-03  7:16 ` Boris Brezillon
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-04-02  9:56 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Steven Price, Liviu Dudau, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Heiko Stuebner,
	Grant Likely, dri-devel, linux-kernel, kernel-janitors

This code accidentally returns zero/success on error because of a typo.
It should be "irq" instead of "ret".  The other thing is that if
platform_get_irq_byname() were to return zero then the error code would
be cmplicated.  Fortunately, it does not so we can just change <= to
< 0.

Fixes: 5cd894e258c4 ("drm/panthor: Add the GPU logical block")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/gpu/drm/panthor/panthor_gpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c
index 0f7c962440d3..5251d8764e7d 100644
--- a/drivers/gpu/drm/panthor/panthor_gpu.c
+++ b/drivers/gpu/drm/panthor/panthor_gpu.c
@@ -211,8 +211,8 @@ int panthor_gpu_init(struct panthor_device *ptdev)
 		return ret;
 
 	irq = platform_get_irq_byname(to_platform_device(ptdev->base.dev), "gpu");
-	if (irq <= 0)
-		return ret;
+	if (irq < 0)
+		return irq;
 
 	ret = panthor_request_gpu_irq(ptdev, &ptdev->gpu->irq, irq, GPU_INTERRUPTS_MASK);
 	if (ret)
-- 
2.43.0


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

* Re: [PATCH] drm/panthor: Fix error code in panthor_gpu_init()
  2024-04-02  9:56 [PATCH] drm/panthor: Fix error code in panthor_gpu_init() Dan Carpenter
@ 2024-04-02 12:20 ` Boris Brezillon
  2024-04-03  7:16 ` Boris Brezillon
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2024-04-02 12:20 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Steven Price, Liviu Dudau, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Heiko Stuebner,
	Grant Likely, dri-devel, linux-kernel, kernel-janitors

On Tue, 2 Apr 2024 12:56:19 +0300
Dan Carpenter <dan.carpenter@linaro.org> wrote:

> This code accidentally returns zero/success on error because of a typo.
> It should be "irq" instead of "ret".  The other thing is that if
> platform_get_irq_byname() were to return zero then the error code would
> be cmplicated.  Fortunately, it does not so we can just change <= to
> < 0.
> 
> Fixes: 5cd894e258c4 ("drm/panthor: Add the GPU logical block")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> ---
>  drivers/gpu/drm/panthor/panthor_gpu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c
> index 0f7c962440d3..5251d8764e7d 100644
> --- a/drivers/gpu/drm/panthor/panthor_gpu.c
> +++ b/drivers/gpu/drm/panthor/panthor_gpu.c
> @@ -211,8 +211,8 @@ int panthor_gpu_init(struct panthor_device *ptdev)
>  		return ret;
>  
>  	irq = platform_get_irq_byname(to_platform_device(ptdev->base.dev), "gpu");
> -	if (irq <= 0)
> -		return ret;
> +	if (irq < 0)
> +		return irq;
>  
>  	ret = panthor_request_gpu_irq(ptdev, &ptdev->gpu->irq, irq, GPU_INTERRUPTS_MASK);
>  	if (ret)


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

* Re: [PATCH] drm/panthor: Fix error code in panthor_gpu_init()
  2024-04-02  9:56 [PATCH] drm/panthor: Fix error code in panthor_gpu_init() Dan Carpenter
  2024-04-02 12:20 ` Boris Brezillon
@ 2024-04-03  7:16 ` Boris Brezillon
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2024-04-03  7:16 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Steven Price, Liviu Dudau, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Heiko Stuebner,
	Grant Likely, dri-devel, linux-kernel, kernel-janitors

On Tue, 2 Apr 2024 12:56:19 +0300
Dan Carpenter <dan.carpenter@linaro.org> wrote:

> This code accidentally returns zero/success on error because of a typo.
> It should be "irq" instead of "ret".  The other thing is that if
> platform_get_irq_byname() were to return zero then the error code would
> be cmplicated.  Fortunately, it does not so we can just change <= to
> < 0.
> 
> Fixes: 5cd894e258c4 ("drm/panthor: Add the GPU logical block")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Queued to drm-misc-next.

Thanks,

Boris

> ---
>  drivers/gpu/drm/panthor/panthor_gpu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c
> index 0f7c962440d3..5251d8764e7d 100644
> --- a/drivers/gpu/drm/panthor/panthor_gpu.c
> +++ b/drivers/gpu/drm/panthor/panthor_gpu.c
> @@ -211,8 +211,8 @@ int panthor_gpu_init(struct panthor_device *ptdev)
>  		return ret;
>  
>  	irq = platform_get_irq_byname(to_platform_device(ptdev->base.dev), "gpu");
> -	if (irq <= 0)
> -		return ret;
> +	if (irq < 0)
> +		return irq;
>  
>  	ret = panthor_request_gpu_irq(ptdev, &ptdev->gpu->irq, irq, GPU_INTERRUPTS_MASK);
>  	if (ret)


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

end of thread, other threads:[~2024-04-03  7:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-02  9:56 [PATCH] drm/panthor: Fix error code in panthor_gpu_init() Dan Carpenter
2024-04-02 12:20 ` Boris Brezillon
2024-04-03  7:16 ` Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox