diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.c b/drivers/gpu/drm/sun4i/sun4i_crtc.c index a5d546a68e1651edb9e19bcdfd66da0f42cb6de8..7d332fce677057cef5ca43b81bc19afa9e5056dd 100644 --- a/drivers/gpu/drm/sun4i/sun4i_crtc.c +++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c @@ -145,7 +145,7 @@ struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm) scrtc = devm_kzalloc(drm->dev, sizeof(*scrtc), GFP_KERNEL); if (!scrtc) - return NULL; + return ERR_PTR(-ENOMEM); scrtc->drv = drv; ret = drm_crtc_init_with_planes(drm, &scrtc->crtc, @@ -155,7 +155,7 @@ struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm) NULL); if (ret) { dev_err(drm->dev, "Couldn't init DRM CRTC\n"); - return NULL; + return ERR_PTR(ret); } drm_crtc_helper_add(&scrtc->crtc, &sun4i_crtc_helper_funcs); diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 46887c3044d0536bce6052b2a2da727025c30ada..9adf1263e1e3fe45a9faf2f1a3a296684f5eea07 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -125,9 +125,9 @@ static int sun4i_drv_bind(struct device *dev) /* Create our CRTC */ drv->crtc = sun4i_crtc_init(drm); - if (!drv->crtc) { + if (IS_ERR(drv->crtc)) { dev_err(drm->dev, "Couldn't create the CRTC\n"); - ret = -EINVAL; + ret = PTR_ERR(drv->crtc); goto cleanup_mode_config; } drm->irq_enabled = true;