]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/mi0283qt: Use devm_drm_dev_alloc
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 15 Apr 2020 07:39:51 +0000 (09:39 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 28 Apr 2020 13:48:00 +0000 (15:48 +0200)
Already using devm_drm_dev_init, so very simple replacment.

Acked-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-17-daniel.vetter@ffwll.ch
drivers/gpu/drm/tiny/mi0283qt.c

index decaf57053ffbb788171e89420b40a0ad062afdb..08ac549ab0f7fc3bc4f5b27f5d0b1277b3aadb8d 100644 (file)
@@ -187,18 +187,13 @@ static int mi0283qt_probe(struct spi_device *spi)
        u32 rotation = 0;
        int ret;
 
-       dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL);
-       if (!dbidev)
-               return -ENOMEM;
+       dbidev = devm_drm_dev_alloc(dev, &mi0283qt_driver,
+                                   struct mipi_dbi_dev, drm);
+       if (IS_ERR(dbidev))
+               return PTR_ERR(dbidev);
 
        dbi = &dbidev->dbi;
        drm = &dbidev->drm;
-       ret = devm_drm_dev_init(dev, drm, &mi0283qt_driver);
-       if (ret) {
-               kfree(dbidev);
-               return ret;
-       }
-       drmm_add_final_kfree(drm, dbidev);
 
        dbi->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
        if (IS_ERR(dbi->reset)) {