drm/st7586: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Acked-by: David Lechner <david@lechnology.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: David Lechner <david@lechnology.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-15-daniel.vetter@ffwll.ch
This commit is contained in:
Daniel Vetter 2020-04-15 09:39:49 +02:00
parent 14877bc715
commit e20b873802
1 changed files with 4 additions and 9 deletions

View File

@ -317,18 +317,13 @@ static int st7586_probe(struct spi_device *spi)
size_t bufsize; size_t bufsize;
int ret; int ret;
dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL); dbidev = devm_drm_dev_alloc(dev, &st7586_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, &st7586_driver);
if (ret) {
kfree(dbidev);
return ret;
}
drmm_add_final_kfree(drm, dbidev);
bufsize = (st7586_mode.vdisplay + 2) / 3 * st7586_mode.hdisplay; bufsize = (st7586_mode.vdisplay + 2) / 3 * st7586_mode.hdisplay;