dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH -next] drm: omapdrm: dss: Remove redundant DSSERR()
  2023-07-27 11:39 [PATCH -next] drm: omapdrm: dss: Remove redundant DSSERR() Ruan Jinjie
@ 2023-07-27  6:57 ` Uwe Kleine-König
  2023-07-27  7:05   ` Ruan Jinjie
  2023-07-27  9:55 ` Laurent Pinchart
  1 sibling, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2023-07-27  6:57 UTC (permalink / raw)
  To: Ruan Jinjie
  Cc: arnd, guozhengkui, tomi.valkeinen, dianders, dri-devel, yuancan,
	laurent.pinchart, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]

Hello,

On Thu, Jul 27, 2023 at 11:39:23AM +0000, Ruan Jinjie wrote:
> There is no need to call the DSSERR() function directly to print
> a custom message when handling an error from platform_get_irq() function
> as it is going to display an appropriate error message
> in case of a failure.
> 
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> ---
>  drivers/gpu/drm/omapdrm/dss/dispc.c | 1 -
>  drivers/gpu/drm/omapdrm/dss/dsi.c   | 4 +---
>  drivers/gpu/drm/omapdrm/dss/hdmi4.c | 1 -
>  drivers/gpu/drm/omapdrm/dss/hdmi5.c | 1 -
>  4 files changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
> index c26aab4939fa..9209103f5dc5 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -4779,7 +4779,6 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)
>  
>  	dispc->irq = platform_get_irq(dispc->pdev, 0);
>  	if (dispc->irq < 0) {
> -		DSSERR("platform_get_irq failed\n");
>  		r = -ENODEV;
>  		goto err_free;
>  	}

Orthogonal to your patch I wonder about r = -ENODEV. Wouldn't r =
dispc->irq be the sensible option? Ditto for the other hunks.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH -next] drm: omapdrm: dss: Remove redundant DSSERR()
  2023-07-27  6:57 ` Uwe Kleine-König
@ 2023-07-27  7:05   ` Ruan Jinjie
  0 siblings, 0 replies; 4+ messages in thread
From: Ruan Jinjie @ 2023-07-27  7:05 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: arnd, guozhengkui, tomi.valkeinen, dianders, dri-devel, yuancan,
	laurent.pinchart, linux-kernel



On 2023/7/27 14:57, Uwe Kleine-König wrote:
> Hello,
> 
> On Thu, Jul 27, 2023 at 11:39:23AM +0000, Ruan Jinjie wrote:
>> There is no need to call the DSSERR() function directly to print
>> a custom message when handling an error from platform_get_irq() function
>> as it is going to display an appropriate error message
>> in case of a failure.
>>
>> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
>> ---
>>  drivers/gpu/drm/omapdrm/dss/dispc.c | 1 -
>>  drivers/gpu/drm/omapdrm/dss/dsi.c   | 4 +---
>>  drivers/gpu/drm/omapdrm/dss/hdmi4.c | 1 -
>>  drivers/gpu/drm/omapdrm/dss/hdmi5.c | 1 -
>>  4 files changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
>> index c26aab4939fa..9209103f5dc5 100644
>> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
>> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
>> @@ -4779,7 +4779,6 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)
>>  
>>  	dispc->irq = platform_get_irq(dispc->pdev, 0);
>>  	if (dispc->irq < 0) {
>> -		DSSERR("platform_get_irq failed\n");
>>  		r = -ENODEV;
>>  		goto err_free;
>>  	}
> 
> Orthogonal to your patch I wonder about r = -ENODEV. Wouldn't r =
> dispc->irq be the sensible option? Ditto for the other hunks.

I agree with you, r = dispc->irq will be more sensible!
> 
> Best regards
> Uwe
> 

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

* Re: [PATCH -next] drm: omapdrm: dss: Remove redundant DSSERR()
  2023-07-27 11:39 [PATCH -next] drm: omapdrm: dss: Remove redundant DSSERR() Ruan Jinjie
  2023-07-27  6:57 ` Uwe Kleine-König
@ 2023-07-27  9:55 ` Laurent Pinchart
  1 sibling, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2023-07-27  9:55 UTC (permalink / raw)
  To: Ruan Jinjie
  Cc: arnd, guozhengkui, tomi.valkeinen, dianders, dri-devel, yuancan,
	u.kleine-koenig, linux-kernel

Hi Ruan,

Thank you for the patch.

On Thu, Jul 27, 2023 at 11:39:23AM +0000, Ruan Jinjie wrote:
> There is no need to call the DSSERR() function directly to print
> a custom message when handling an error from platform_get_irq() function
> as it is going to display an appropriate error message
> in case of a failure.
> 
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>

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

I expect Tomi to pick this up and push it to drm-misc.

> ---
>  drivers/gpu/drm/omapdrm/dss/dispc.c | 1 -
>  drivers/gpu/drm/omapdrm/dss/dsi.c   | 4 +---
>  drivers/gpu/drm/omapdrm/dss/hdmi4.c | 1 -
>  drivers/gpu/drm/omapdrm/dss/hdmi5.c | 1 -
>  4 files changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
> index c26aab4939fa..9209103f5dc5 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -4779,7 +4779,6 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)
>  
>  	dispc->irq = platform_get_irq(dispc->pdev, 0);
>  	if (dispc->irq < 0) {
> -		DSSERR("platform_get_irq failed\n");
>  		r = -ENODEV;
>  		goto err_free;
>  	}
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index ea63c64d3a1a..63cfe0776788 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -4935,10 +4935,8 @@ static int dsi_probe(struct platform_device *pdev)
>  		return PTR_ERR(dsi->pll_base);
>  
>  	dsi->irq = platform_get_irq(pdev, 0);
> -	if (dsi->irq < 0) {
> -		DSSERR("platform_get_irq failed\n");
> +	if (dsi->irq < 0)
>  		return -ENODEV;
> -	}
>  
>  	r = devm_request_irq(dev, dsi->irq, omap_dsi_irq_handler,
>  			     IRQF_SHARED, dev_name(dev), dsi);
> diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
> index a26b77d99d52..d4fd6c680db3 100644
> --- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
> +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
> @@ -782,7 +782,6 @@ static int hdmi4_probe(struct platform_device *pdev)
>  
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0) {
> -		DSSERR("platform_get_irq failed\n");
>  		r = -ENODEV;
>  		goto err_free;
>  	}
> diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
> index e6611c683857..27c21ff8c4e5 100644
> --- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
> +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
> @@ -756,7 +756,6 @@ static int hdmi5_probe(struct platform_device *pdev)
>  
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0) {
> -		DSSERR("platform_get_irq failed\n");
>  		r = -ENODEV;
>  		goto err_free;
>  	}

-- 
Regards,

Laurent Pinchart

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

* [PATCH -next] drm: omapdrm: dss: Remove redundant DSSERR()
@ 2023-07-27 11:39 Ruan Jinjie
  2023-07-27  6:57 ` Uwe Kleine-König
  2023-07-27  9:55 ` Laurent Pinchart
  0 siblings, 2 replies; 4+ messages in thread
From: Ruan Jinjie @ 2023-07-27 11:39 UTC (permalink / raw)
  To: tomi.valkeinen, airlied, daniel, laurent.pinchart,
	u.kleine-koenig, guozhengkui, dianders, yuancan, arnd, dri-devel,
	linux-kernel
  Cc: ruanjinjie

There is no need to call the DSSERR() function directly to print
a custom message when handling an error from platform_get_irq() function
as it is going to display an appropriate error message
in case of a failure.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 1 -
 drivers/gpu/drm/omapdrm/dss/dsi.c   | 4 +---
 drivers/gpu/drm/omapdrm/dss/hdmi4.c | 1 -
 drivers/gpu/drm/omapdrm/dss/hdmi5.c | 1 -
 4 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index c26aab4939fa..9209103f5dc5 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -4779,7 +4779,6 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)
 
 	dispc->irq = platform_get_irq(dispc->pdev, 0);
 	if (dispc->irq < 0) {
-		DSSERR("platform_get_irq failed\n");
 		r = -ENODEV;
 		goto err_free;
 	}
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index ea63c64d3a1a..63cfe0776788 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -4935,10 +4935,8 @@ static int dsi_probe(struct platform_device *pdev)
 		return PTR_ERR(dsi->pll_base);
 
 	dsi->irq = platform_get_irq(pdev, 0);
-	if (dsi->irq < 0) {
-		DSSERR("platform_get_irq failed\n");
+	if (dsi->irq < 0)
 		return -ENODEV;
-	}
 
 	r = devm_request_irq(dev, dsi->irq, omap_dsi_irq_handler,
 			     IRQF_SHARED, dev_name(dev), dsi);
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index a26b77d99d52..d4fd6c680db3 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -782,7 +782,6 @@ static int hdmi4_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		DSSERR("platform_get_irq failed\n");
 		r = -ENODEV;
 		goto err_free;
 	}
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index e6611c683857..27c21ff8c4e5 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -756,7 +756,6 @@ static int hdmi5_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		DSSERR("platform_get_irq failed\n");
 		r = -ENODEV;
 		goto err_free;
 	}
-- 
2.34.1


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

end of thread, other threads:[~2023-07-27  9:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-27 11:39 [PATCH -next] drm: omapdrm: dss: Remove redundant DSSERR() Ruan Jinjie
2023-07-27  6:57 ` Uwe Kleine-König
2023-07-27  7:05   ` Ruan Jinjie
2023-07-27  9:55 ` Laurent Pinchart

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).