drm/<drivers>: Use drmm_add_final_kfree
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 23 Mar 2020 14:49:17 +0000 (15:49 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 26 Mar 2020 14:26:52 +0000 (15:26 +0100)
These are the leftover drivers that didn't have a ->release hook that
needed to be updated.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: "James (Qian) Wang" <james.qian.wang@arm.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Mihail Atanassov <mihail.atanassov@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-19-daniel.vetter@ffwll.ch
drivers/gpu/drm/arm/display/komeda/komeda_kms.c
drivers/gpu/drm/armada/armada_drv.c
drivers/gpu/drm/vboxvideo/vbox_drv.c

index 442d4656150ae664b8e1ebc3a511beec83505126..16dfd5cdb66c50ba892b25ca09247b6babae8687 100644 (file)
@@ -14,6 +14,7 @@
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_irq.h>
+#include <drm/drm_managed.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_vblank.h>
 
@@ -271,6 +272,7 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
        err = drm_dev_init(drm, &komeda_kms_driver, mdev->dev);
        if (err)
                goto free_kms;
+       drmm_add_final_kfree(drm, kms);
 
        drm->dev_private = mdev;
 
index 197dca3fc84c2d71d8220d3f797f03e6daf3e351..dd9ed71ed942811d6ae958b1f26cadfd6fe26a17 100644 (file)
@@ -12,6 +12,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_ioctl.h>
+#include <drm/drm_managed.h>
 #include <drm/drm_prime.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -103,6 +104,7 @@ static int armada_drm_bind(struct device *dev)
                kfree(priv);
                return ret;
        }
+       drmm_add_final_kfree(&priv->drm, priv);
 
        /* Remove early framebuffers */
        ret = drm_fb_helper_remove_conflicting_framebuffers(NULL,
index 8512d970a09fdfaaade47f5257d529f21672c4d3..13eaae7921f5730c1f7ec0d1124f612fb0cee484 100644 (file)
@@ -17,6 +17,7 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_file.h>
 #include <drm/drm_ioctl.h>
+#include <drm/drm_managed.h>
 
 #include "vbox_drv.h"
 
@@ -54,6 +55,7 @@ static int vbox_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        vbox->ddev.pdev = pdev;
        vbox->ddev.dev_private = vbox;
        pci_set_drvdata(pdev, vbox);
+       drmm_add_final_kfree(&vbox->ddev, vbox);
        mutex_init(&vbox->hw_mutex);
 
        ret = pci_enable_device(pdev);