]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/mipi_dbi: Use drmm_add_final_kfree in all drivers
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 23 Mar 2020 14:49:04 +0000 (15:49 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 26 Mar 2020 13:49:51 +0000 (14:49 +0100)
They all share mipi_dbi_release so we need to switch them all
together. With this we can drop the final kfree from the release
function.

Aside, I think we could perhaps have a tiny additional helper for
these mipi_dbi drivers, the first few lines around devm_drm_dev_init
are all the same (except for the drm_driver pointer).

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Tested-by: Noralf Trønnes <noralf@tronnes.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Cc: David Lechner <david@lechnology.com>
Cc: Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-6-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_mipi_dbi.c
drivers/gpu/drm/tiny/hx8357d.c
drivers/gpu/drm/tiny/ili9225.c
drivers/gpu/drm/tiny/ili9341.c
drivers/gpu/drm/tiny/ili9486.c
drivers/gpu/drm/tiny/mi0283qt.c
drivers/gpu/drm/tiny/st7586.c
drivers/gpu/drm/tiny/st7735r.c

index ea929bc1e663bc44f7ef36a2a1944c9a13ff79d2..98d0af8376fd684b060eb11d868c35e2f359f256 100644 (file)
@@ -589,13 +589,10 @@ EXPORT_SYMBOL(mipi_dbi_dev_init);
  */
 void mipi_dbi_release(struct drm_device *drm)
 {
-       struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(drm);
-
        DRM_DEBUG_DRIVER("\n");
 
        drm_mode_config_cleanup(drm);
        drm_dev_fini(drm);
-       kfree(dbidev);
 }
 EXPORT_SYMBOL(mipi_dbi_release);
 
index 9af8ff84974f5ca99a8095c5965640bef46249fb..42bc5dadcb1c035a3fd859deaa12dfc1bfbec34d 100644 (file)
@@ -21,6 +21,7 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_managed.h>
 #include <drm/drm_mipi_dbi.h>
 #include <drm/drm_modeset_helper.h>
 #include <video/mipi_display.h>
@@ -236,6 +237,7 @@ static int hx8357d_probe(struct spi_device *spi)
                kfree(dbidev);
                return ret;
        }
+       drmm_add_final_kfree(drm, dbidev);
 
        drm_mode_config_init(drm);
 
index 802fb8dde1b61b98a047de9f2a508aac1e0b23fc..aae88dc5b3f781210a7e61bad78569b234d313c8 100644 (file)
@@ -24,6 +24,7 @@
 #include <drm/drm_fourcc.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_managed.h>
 #include <drm/drm_mipi_dbi.h>
 #include <drm/drm_rect.h>
 
@@ -387,6 +388,7 @@ static int ili9225_probe(struct spi_device *spi)
                kfree(dbidev);
                return ret;
        }
+       drmm_add_final_kfree(drm, dbidev);
 
        drm_mode_config_init(drm);
 
index 33b51dc7faa87359b3b8886ebfa7aa33908a375b..7d40cb4ff72be82379914cd148cdf1c5880340bc 100644 (file)
@@ -20,6 +20,7 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_managed.h>
 #include <drm/drm_mipi_dbi.h>
 #include <drm/drm_modeset_helper.h>
 #include <video/mipi_display.h>
@@ -194,6 +195,7 @@ static int ili9341_probe(struct spi_device *spi)
                kfree(dbidev);
                return ret;
        }
+       drmm_add_final_kfree(drm, dbidev);
 
        drm_mode_config_init(drm);
 
index 532560aebb1e0fa2f08ec33e5f500588f054facf..9515eed2625c075c6a0da3388e3d5604a01ca244 100644 (file)
@@ -19,6 +19,7 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_managed.h>
 #include <drm/drm_mipi_dbi.h>
 #include <drm/drm_modeset_helper.h>
 
@@ -208,6 +209,7 @@ static int ili9486_probe(struct spi_device *spi)
                kfree(dbidev);
                return ret;
        }
+       drmm_add_final_kfree(drm, dbidev);
 
        drm_mode_config_init(drm);
 
index e2cfd9a171436cd6fe752f35ad9744fa3fec9c73..8555a56bce8c29f9d440757cbafae993a2834694 100644 (file)
@@ -18,6 +18,7 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_managed.h>
 #include <drm/drm_mipi_dbi.h>
 #include <drm/drm_modeset_helper.h>
 #include <video/mipi_display.h>
@@ -198,6 +199,7 @@ static int mi0283qt_probe(struct spi_device *spi)
                kfree(dbidev);
                return ret;
        }
+       drmm_add_final_kfree(drm, dbidev);
 
        drm_mode_config_init(drm);
 
index 9ef559dd3191cfd459ab7f497cc983f1d0548976..427c2561f5f4f3bffed391affae49aec04e50c19 100644 (file)
@@ -21,6 +21,7 @@
 #include <drm/drm_format_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_managed.h>
 #include <drm/drm_mipi_dbi.h>
 #include <drm/drm_rect.h>
 
@@ -328,6 +329,7 @@ static int st7586_probe(struct spi_device *spi)
                kfree(dbidev);
                return ret;
        }
+       drmm_add_final_kfree(drm, dbidev);
 
        drm_mode_config_init(drm);
 
index 3cd9b8d9888d639607da4701ae9fbad4f17a34d1..0790975695406da25467820b3511fca17421e308 100644 (file)
@@ -21,6 +21,7 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_managed.h>
 #include <drm/drm_mipi_dbi.h>
 
 #define ST7735R_FRMCTR1                0xb1
@@ -209,6 +210,7 @@ static int st7735r_probe(struct spi_device *spi)
                kfree(dbidev);
                return ret;
        }
+       drmm_add_final_kfree(drm, dbidev);
 
        drm_mode_config_init(drm);