From: Tomi Valkeinen Date: Wed, 2 Apr 2014 10:47:43 +0000 (+0300) Subject: drm/omap: fix uninit order in pdev_remove() X-Git-Tag: v4.9.8~6504^2~8^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=707cf58a0a847f60f849b44bfb9b85dcc17c599d;p=platform%2Fkernel%2Flinux-rpi3.git drm/omap: fix uninit order in pdev_remove() When unloading omapdrm driver, the omapdrm platform device is uninitialized last, after the displays have been disconnected omap_crtc callbacks have been removed. As the omapdrm pdev uninitialization needs the features uninitialized in earlier steps, a crash is guaranteed. This patch fixes the uninitialize order so that the omapdrm pdev is removed first. Signed-off-by: Tomi Valkeinen Reviewed-by: Rob Clark --- diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index bf39fcc..df3e664 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -696,10 +696,11 @@ static int pdev_remove(struct platform_device *device) { DBG(""); + drm_put_dev(platform_get_drvdata(device)); + omap_disconnect_dssdevs(); omap_crtc_pre_uninit(); - drm_put_dev(platform_get_drvdata(device)); return 0; }