From: Jeffy Chen Date: Thu, 6 Apr 2017 12:31:17 +0000 (+0800) Subject: drm: bridge: analogix: Destroy connector & encoder when unbinding X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=37e0487788468cc0dfef678f4d10339c28ad80e5;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: bridge: analogix: Destroy connector & encoder when unbinding Normally we do this in drm_mode_config_cleanup. But: 1/ analogix dp's connector is allocated in bind, and freed after unbind. So we need to destroy it in unbind to avoid further access. 2/ the drm bridge is attached in bind, and detached in encoder cleanup. So we need to destroy encoder in unbind. Signed-off-by: Jeffy Chen Reviewed-by: Andrzej Hajda Signed-off-by: Sean Paul Link: http://patchwork.freedesktop.org/patch/msgid/1491481885-13775-5-git-send-email-jeffy.chen@rock-chips.com --- diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index d05ade4fb7fd..4c758ed51939 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1439,6 +1439,8 @@ void analogix_dp_unbind(struct device *dev, struct device *master, struct analogix_dp_device *dp = dev_get_drvdata(dev); analogix_dp_bridge_disable(dp->bridge); + dp->connector.funcs->destroy(&dp->connector); + dp->encoder->funcs->destroy(dp->encoder); if (dp->plat_data->panel) { if (drm_panel_unprepare(dp->plat_data->panel))