]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/repaper: Use devm_drm_dev_alloc
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 15 Apr 2020 07:39:50 +0000 (09:39 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 28 Apr 2020 13:47:54 +0000 (15:47 +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-16-daniel.vetter@ffwll.ch
drivers/gpu/drm/tiny/repaper.c

index 862c3ee6055de785d306d550efd8ed37cf0cb921..1c0e7169545b4ae4e8ea7c95e60c15217edb5214 100644 (file)
@@ -1002,19 +1002,13 @@ static int repaper_probe(struct spi_device *spi)
                }
        }
 
-       epd = kzalloc(sizeof(*epd), GFP_KERNEL);
-       if (!epd)
-               return -ENOMEM;
+       epd = devm_drm_dev_alloc(dev, &repaper_driver,
+                                struct repaper_epd, drm);
+       if (IS_ERR(epd))
+               return PTR_ERR(epd);
 
        drm = &epd->drm;
 
-       ret = devm_drm_dev_init(dev, drm, &repaper_driver);
-       if (ret) {
-               kfree(epd);
-               return ret;
-       }
-       drmm_add_final_kfree(drm, epd);
-
        ret = drmm_mode_config_init(drm);
        if (ret)
                return ret;