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
This commit is contained in:
Daniel Vetter 2020-04-15 09:39:50 +02:00
parent e20b873802
commit 98904f3d2d
1 changed files with 4 additions and 10 deletions

View 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;