diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2020-04-15 10:39:50 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2020-04-28 16:47:54 +0300 |
commit | 98904f3d2d92f4a3c3101dcaaa09eb5377f38ce8 (patch) | |
tree | 39fea4714935c02569577ab26febb0b93cb60444 /drivers/gpu/drm/tiny/repaper.c | |
parent | e20b873802b6a8c8c65cd85ecf79a3615f3a0a5c (diff) | |
download | linux-98904f3d2d92f4a3c3101dcaaa09eb5377f38ce8.tar.xz |
drm/repaper: Use devm_drm_dev_alloc
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
Diffstat (limited to 'drivers/gpu/drm/tiny/repaper.c')
-rw-r--r-- | drivers/gpu/drm/tiny/repaper.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c index 862c3ee6055d..1c0e7169545b 100644 --- a/drivers/gpu/drm/tiny/repaper.c +++ b/drivers/gpu/drm/tiny/repaper.c @@ -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; |