*/
imxdrm->drm->vblank_disable_allowed = true;
- if (!imx_drm_device_get())
+ if (!imx_drm_device_get()) {
ret = -EINVAL;
+ goto err_vblank;
+ }
+ platform_set_drvdata(drm->platformdev, drm);
+ mutex_unlock(&imxdrm->mutex);
+ return 0;
- ret = 0;
-
- err_init:
+ err_vblank:
+ drm_vblank_cleanup(drm);
+ err_kms:
+ drm_kms_helper_poll_fini(drm);
+ drm_mode_config_cleanup(drm);
mutex_unlock(&imxdrm->mutex);
return ret;