diff options
Diffstat (limited to 'drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c')
-rw-r--r-- | drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 3d3cf2f8891e..d5cfef75fc80 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | |||
@@ -271,8 +271,6 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, | |||
271 | if (!iores) | 271 | if (!iores) |
272 | return -ENXIO; | 272 | return -ENXIO; |
273 | 273 | ||
274 | platform_set_drvdata(pdev, hdmi); | ||
275 | |||
276 | encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node); | 274 | encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node); |
277 | /* | 275 | /* |
278 | * If we failed to find the CRTC(s) which this encoder is | 276 | * If we failed to find the CRTC(s) which this encoder is |
@@ -293,7 +291,16 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, | |||
293 | drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs, | 291 | drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs, |
294 | DRM_MODE_ENCODER_TMDS, NULL); | 292 | DRM_MODE_ENCODER_TMDS, NULL); |
295 | 293 | ||
296 | return dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data); | 294 | ret = dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data); |
295 | |||
296 | /* | ||
297 | * If dw_hdmi_bind() fails we'll never call dw_hdmi_unbind(), | ||
298 | * which would have called the encoder cleanup. Do it manually. | ||
299 | */ | ||
300 | if (ret) | ||
301 | drm_encoder_cleanup(encoder); | ||
302 | |||
303 | return ret; | ||
297 | } | 304 | } |
298 | 305 | ||
299 | static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master, | 306 | static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master, |