diff options
Diffstat (limited to 'drivers/gpu/drm/imx/dw_hdmi-imx.c')
-rw-r--r-- | drivers/gpu/drm/imx/dw_hdmi-imx.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/imx/dw_hdmi-imx.c b/drivers/gpu/drm/imx/dw_hdmi-imx.c index 2a95d10e9d92..a24631fdf4ad 100644 --- a/drivers/gpu/drm/imx/dw_hdmi-imx.c +++ b/drivers/gpu/drm/imx/dw_hdmi-imx.c | |||
@@ -225,8 +225,6 @@ static int dw_hdmi_imx_bind(struct device *dev, struct device *master, | |||
225 | if (!iores) | 225 | if (!iores) |
226 | return -ENXIO; | 226 | return -ENXIO; |
227 | 227 | ||
228 | platform_set_drvdata(pdev, hdmi); | ||
229 | |||
230 | encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node); | 228 | encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node); |
231 | /* | 229 | /* |
232 | * If we failed to find the CRTC(s) which this encoder is | 230 | * If we failed to find the CRTC(s) which this encoder is |
@@ -245,7 +243,16 @@ static int dw_hdmi_imx_bind(struct device *dev, struct device *master, | |||
245 | drm_encoder_init(drm, encoder, &dw_hdmi_imx_encoder_funcs, | 243 | drm_encoder_init(drm, encoder, &dw_hdmi_imx_encoder_funcs, |
246 | DRM_MODE_ENCODER_TMDS, NULL); | 244 | DRM_MODE_ENCODER_TMDS, NULL); |
247 | 245 | ||
248 | return dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data); | 246 | ret = dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data); |
247 | |||
248 | /* | ||
249 | * If dw_hdmi_bind() fails we'll never call dw_hdmi_unbind(), | ||
250 | * which would have called the encoder cleanup. Do it manually. | ||
251 | */ | ||
252 | if (ret) | ||
253 | drm_encoder_cleanup(encoder); | ||
254 | |||
255 | return ret; | ||
249 | } | 256 | } |
250 | 257 | ||
251 | static void dw_hdmi_imx_unbind(struct device *dev, struct device *master, | 258 | static void dw_hdmi_imx_unbind(struct device *dev, struct device *master, |