diff options
author | Dave Airlie <airlied@redhat.com> | 2016-11-17 01:55:26 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-11-17 01:55:26 +0300 |
commit | 25bfe018c1c57955e763ebfa2c1fa54283e426e9 (patch) | |
tree | 7da465d9820436bbae1f2dfd3a55d7ef60e64940 /drivers/gpu/drm/arm/hdlcd_drv.c | |
parent | 318313d1d4c17c2cadbb61cec43ef9f9cd136aab (diff) | |
parent | 90731c24d2db7ec04df43ddbcee9605183d05187 (diff) | |
download | linux-25bfe018c1c57955e763ebfa2c1fa54283e426e9.tar.xz |
Merge branch 'drm-tda998x-mali' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next
Fix conncector registration with tda998x.
* 'drm-tda998x-mali' of git://git.armlinux.org.uk/~rmk/linux-arm:
drm/i2c: tda998x: mali-dp: hdlcd: refactor connector registration
Diffstat (limited to 'drivers/gpu/drm/arm/hdlcd_drv.c')
-rw-r--r-- | drivers/gpu/drm/arm/hdlcd_drv.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 59747ecaad54..faab7f9bd3b7 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -335,14 +335,10 @@ static int hdlcd_drm_bind(struct device *dev) if (ret) goto err_free; - ret = drm_dev_register(drm, 0); - if (ret) - goto err_unload; - ret = component_bind_all(dev, drm); if (ret) { DRM_ERROR("Failed to bind all components\n"); - goto err_unregister; + goto err_unload; } ret = pm_runtime_set_active(dev); @@ -369,8 +365,17 @@ static int hdlcd_drm_bind(struct device *dev) goto err_fbdev; } + ret = drm_dev_register(drm, 0); + if (ret) + goto err_register; + return 0; +err_register: + if (hdlcd->fbdev) { + drm_fbdev_cma_fini(hdlcd->fbdev); + hdlcd->fbdev = NULL; + } err_fbdev: drm_kms_helper_poll_fini(drm); drm_mode_config_cleanup(drm); @@ -379,8 +384,6 @@ err_vblank: pm_runtime_disable(drm->dev); err_pm_active: component_unbind_all(dev, drm); -err_unregister: - drm_dev_unregister(drm); err_unload: drm_irq_uninstall(drm); of_reserved_mem_device_release(drm->dev); @@ -396,6 +399,7 @@ static void hdlcd_drm_unbind(struct device *dev) struct drm_device *drm = dev_get_drvdata(dev); struct hdlcd_drm_private *hdlcd = drm->dev_private; + drm_dev_unregister(drm); if (hdlcd->fbdev) { drm_fbdev_cma_fini(hdlcd->fbdev); hdlcd->fbdev = NULL; @@ -409,7 +413,6 @@ static void hdlcd_drm_unbind(struct device *dev) pm_runtime_disable(drm->dev); of_reserved_mem_device_release(drm->dev); drm_mode_config_cleanup(drm); - drm_dev_unregister(drm); drm_dev_unref(drm); drm->dev_private = NULL; dev_set_drvdata(dev, NULL); |