summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>2019-04-24 12:04:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-16 20:40:25 +0300
commit21a3f7c2c76c71d49452437735a852e3fa923c3a (patch)
tree37ac9e6dc12f572a3ce72e849aa3a2dd3285e019
parentf79084e5372b449c09d0d3771b06a3f010b924b6 (diff)
downloadlinux-21a3f7c2c76c71d49452437735a852e3fa923c3a.tar.xz
drm/sun4i: Unbind components before releasing DRM and memory
[ Upstream commit e02bc29b2cfa7806830d6da8b2322cddd67e8dfe ] 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: f5a9ed867c83 ("drm/sun4i: Fix component unbinding and component master deletion") Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Link: https://patchwork.freedesktop.org/patch/msgid/20190424090413.6918-1-paul.kocialkowski@bootlin.com Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_drv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
index 9a5713fa03b2..f8bf5bbec2df 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -146,10 +146,11 @@ static void sun4i_drv_unbind(struct device *dev)
drm_dev_unregister(drm);
drm_kms_helper_poll_fini(drm);
drm_mode_config_cleanup(drm);
- of_reserved_mem_device_release(dev);
- drm_dev_put(drm);
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 = {