Support using drm_fb_helper_unregister_fbi() in driver.remove prior to calling drm_fbdev_cma_fini() in drm_driver.release. Also make drm_fbdev_cma_fini() NULL tolerant. Cc: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> Signed-off-by: Noralf Trønnes <noralf@xxxxxxxxxxx> --- drivers/gpu/drm/drm_fb_cma_helper.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index a5dc586..2030a6f 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -466,7 +466,13 @@ EXPORT_SYMBOL_GPL(drm_fbdev_cma_init); */ void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma) { - drm_fb_helper_unregister_fbi(&fbdev_cma->fb_helper); + if (!fbdev_cma) + return; + + /* Make sure it hasn't been unregistered already */ + if (fbdev_cma->fb_helper.fbdev && fbdev_cma->fb_helper.fbdev->dev) + drm_fb_helper_unregister_fbi(&fbdev_cma->fb_helper); + if (fbdev_cma->fb_helper.fbdev) drm_fbdev_cma_defio_fini(fbdev_cma->fb_helper.fbdev); -- 2.7.4 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel