pm_runtime_enable(dev);
- drm_simple_encoder_init(drm, &vec->encoder.base, DRM_MODE_ENCODER_TVDAC);
+ ret = drmm_encoder_init(drm, &vec->encoder.base,
+ NULL,
+ DRM_MODE_ENCODER_TVDAC,
+ NULL);
+ if (ret)
+ goto err_put_runtime_pm;
+
drm_encoder_helper_add(&vec->encoder.base, &vc4_vec_encoder_helper_funcs);
ret = vc4_vec_connector_init(drm, vec);
if (ret)
- goto err_destroy_encoder;
+ goto err_put_runtime_pm;
dev_set_drvdata(dev, vec);
return 0;
-err_destroy_encoder:
- drm_encoder_cleanup(&vec->encoder.base);
+err_put_runtime_pm:
pm_runtime_disable(dev);
return ret;
struct vc4_vec *vec = dev_get_drvdata(dev);
drm_connector_cleanup(&vec->connector);
- drm_encoder_cleanup(&vec->encoder.base);
pm_runtime_disable(dev);
}