All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] drm: ARM HDLCD - fix an error code
@ 2016-04-02  5:42 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2016-04-02  5:42 UTC (permalink / raw)
  To: Liviu Dudau, Alexey Brodkin; +Cc: David Airlie, dri-devel, kernel-janitors

We accidentally return PTR_ERR(NULL) which is success instead of a
negative error code.

Fixes: 879e40bea6f2 ('drm: ARM HDLCD - get rid of devm_clk_put()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 734849f..3ac1ae4 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -55,8 +55,9 @@ static int hdlcd_load(struct drm_device *drm, unsigned long flags)
 	hdlcd->mmio = devm_ioremap_resource(drm->dev, res);
 	if (IS_ERR(hdlcd->mmio)) {
 		DRM_ERROR("failed to map control registers area\n");
+		ret = PTR_ERR(hdlcd->mmio);
 		hdlcd->mmio = NULL;
-		return PTR_ERR(hdlcd->mmio);
+		return ret;
 	}
 
 	version = hdlcd_read(hdlcd, HDLCD_REG_VERSION);

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

* [patch] drm: ARM HDLCD - fix an error code
@ 2016-04-02  5:42 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2016-04-02  5:42 UTC (permalink / raw)
  To: Liviu Dudau, Alexey Brodkin; +Cc: David Airlie, dri-devel, kernel-janitors

We accidentally return PTR_ERR(NULL) which is success instead of a
negative error code.

Fixes: 879e40bea6f2 ('drm: ARM HDLCD - get rid of devm_clk_put()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 734849f..3ac1ae4 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -55,8 +55,9 @@ static int hdlcd_load(struct drm_device *drm, unsigned long flags)
 	hdlcd->mmio = devm_ioremap_resource(drm->dev, res);
 	if (IS_ERR(hdlcd->mmio)) {
 		DRM_ERROR("failed to map control registers area\n");
+		ret = PTR_ERR(hdlcd->mmio);
 		hdlcd->mmio = NULL;
-		return PTR_ERR(hdlcd->mmio);
+		return ret;
 	}
 
 	version = hdlcd_read(hdlcd, HDLCD_REG_VERSION);

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

* Re: [patch] drm: ARM HDLCD - fix an error code
  2016-04-02  5:42 ` Dan Carpenter
@ 2016-04-04  9:17   ` Liviu Dudau
  -1 siblings, 0 replies; 4+ messages in thread
From: Liviu Dudau @ 2016-04-04  9:17 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Alexey Brodkin, kernel-janitors, dri-devel

On Sat, Apr 02, 2016 at 08:42:24AM +0300, Dan Carpenter wrote:
> We accidentally return PTR_ERR(NULL) which is success instead of a
> negative error code.
> 
> Fixes: 879e40bea6f2 ('drm: ARM HDLCD - get rid of devm_clk_put()')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index 734849f..3ac1ae4 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -55,8 +55,9 @@ static int hdlcd_load(struct drm_device *drm, unsigned long flags)
>  	hdlcd->mmio = devm_ioremap_resource(drm->dev, res);
>  	if (IS_ERR(hdlcd->mmio)) {
>  		DRM_ERROR("failed to map control registers area\n");
> +		ret = PTR_ERR(hdlcd->mmio);
>  		hdlcd->mmio = NULL;
> -		return PTR_ERR(hdlcd->mmio);
> +		return ret;

Good catch, thanks for that!

Acked-by: Liviu Dudau <Liviu.Dudau@arm.com>

I've pulled your patch and sent an updated pull request.

Best regards,
Liviu


>  	}
>  
>  	version = hdlcd_read(hdlcd, HDLCD_REG_VERSION);
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
==========
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

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

* Re: [patch] drm: ARM HDLCD - fix an error code
@ 2016-04-04  9:17   ` Liviu Dudau
  0 siblings, 0 replies; 4+ messages in thread
From: Liviu Dudau @ 2016-04-04  9:17 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Alexey Brodkin, kernel-janitors, dri-devel

On Sat, Apr 02, 2016 at 08:42:24AM +0300, Dan Carpenter wrote:
> We accidentally return PTR_ERR(NULL) which is success instead of a
> negative error code.
> 
> Fixes: 879e40bea6f2 ('drm: ARM HDLCD - get rid of devm_clk_put()')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index 734849f..3ac1ae4 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -55,8 +55,9 @@ static int hdlcd_load(struct drm_device *drm, unsigned long flags)
>  	hdlcd->mmio = devm_ioremap_resource(drm->dev, res);
>  	if (IS_ERR(hdlcd->mmio)) {
>  		DRM_ERROR("failed to map control registers area\n");
> +		ret = PTR_ERR(hdlcd->mmio);
>  		hdlcd->mmio = NULL;
> -		return PTR_ERR(hdlcd->mmio);
> +		return ret;

Good catch, thanks for that!

Acked-by: Liviu Dudau <Liviu.Dudau@arm.com>

I've pulled your patch and sent an updated pull request.

Best regards,
Liviu


>  	}
>  
>  	version = hdlcd_read(hdlcd, HDLCD_REG_VERSION);
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-04-04  9:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-02  5:42 [patch] drm: ARM HDLCD - fix an error code Dan Carpenter
2016-04-02  5:42 ` Dan Carpenter
2016-04-04  9:17 ` Liviu Dudau
2016-04-04  9:17   ` Liviu Dudau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.