From: Daniel Vetter Date: Mon, 23 Mar 2020 14:49:11 +0000 (+0100) Subject: drm/mcde: Use drmm_add_final_kfree X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e2edcaaa3da88018bf6afd4dd09b8b5b4f8e8443;p=linux.git drm/mcde: Use drmm_add_final_kfree With this we can drop the final kfree from the release function. v2: Fix unused variable warning, spotted while applying. Reviewed-by: Linus Walleij Signed-off-by: Daniel Vetter Cc: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-13-daniel.vetter@ffwll.ch --- diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c index f28cb7a576ba4..51140a22240ac 100644 --- a/drivers/gpu/drm/mcde/mcde_drv.c +++ b/drivers/gpu/drm/mcde/mcde_drv.c @@ -72,6 +72,7 @@ #include #include #include +#include #include #include #include @@ -219,11 +220,8 @@ out_config: static void mcde_release(struct drm_device *drm) { - struct mcde *mcde = drm->dev_private; - drm_mode_config_cleanup(drm); drm_dev_fini(drm); - kfree(mcde); } DEFINE_DRM_GEM_CMA_FOPS(drm_fops); @@ -330,6 +328,7 @@ static int mcde_probe(struct platform_device *pdev) } drm = &mcde->drm; drm->dev_private = mcde; + drmm_add_final_kfree(drm, mcde); platform_set_drvdata(pdev, drm); /* Enable continuous updates: this is what Linux' framebuffer expects */