drm/ili9486: 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: Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-18-daniel.vetter@ffwll.ch
This commit is contained in:
Daniel Vetter 2020-04-15 09:39:52 +02:00
parent 35d8ef4ba2
commit 3d49ea2294
1 changed files with 4 additions and 9 deletions

View File

@ -197,18 +197,13 @@ static int ili9486_probe(struct spi_device *spi)
u32 rotation = 0; u32 rotation = 0;
int ret; int ret;
dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL); dbidev = devm_drm_dev_alloc(dev, &ili9486_driver,
if (!dbidev) struct mipi_dbi_dev, drm);
return -ENOMEM; if (IS_ERR(dbidev))
return PTR_ERR(dbidev);
dbi = &dbidev->dbi; dbi = &dbidev->dbi;
drm = &dbidev->drm; drm = &dbidev->drm;
ret = devm_drm_dev_init(dev, drm, &ili9486_driver);
if (ret) {
kfree(dbidev);
return ret;
}
drmm_add_final_kfree(drm, dbidev);
dbi->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); dbi->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(dbi->reset)) { if (IS_ERR(dbi->reset)) {