提交 4fe30a19 编写于 作者: P Paul Kocialkowski 提交者: Xie XiuQi

drm/sun4i: Unbind components before releasing DRM and memory

[ Upstream commit e02bc29b ]

Our components may still be using the DRM device driver (if only to
access our driver's private data), so make sure to unbind them before
the final drm_dev_put.

Also release our reserved memory after component unbind instead of
before to match reverse creation order.

Fixes: f5a9ed86 ("drm/sun4i: Fix component unbinding and component master deletion")
Signed-off-by: NPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: NChen-Yu Tsai <wens@csie.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190424090413.6918-1-paul.kocialkowski@bootlin.comSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 2e8df11a
...@@ -158,10 +158,11 @@ static void sun4i_drv_unbind(struct device *dev) ...@@ -158,10 +158,11 @@ static void sun4i_drv_unbind(struct device *dev)
drm_kms_helper_poll_fini(drm); drm_kms_helper_poll_fini(drm);
sun4i_framebuffer_free(drm); sun4i_framebuffer_free(drm);
drm_mode_config_cleanup(drm); drm_mode_config_cleanup(drm);
of_reserved_mem_device_release(dev);
drm_dev_put(drm);
component_unbind_all(dev, NULL); component_unbind_all(dev, NULL);
of_reserved_mem_device_release(dev);
drm_dev_put(drm);
} }
static const struct component_master_ops sun4i_drv_master_ops = { static const struct component_master_ops sun4i_drv_master_ops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册