drm: ARM HDLCD - fix an error code
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 2 Apr 2016 05:42:24 +0000 (08:42 +0300)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Mon, 4 Apr 2016 09:11:33 +0000 (10:11 +0100)
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>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
drivers/gpu/drm/arm/hdlcd_drv.c

index 734849fafe2803180ff36ec012a8980b9e36e71d..3ac1ae4d8cafb69993035ab505727c3d127cc962 100644 (file)
@@ -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);