Commit e20b8738 authored by Daniel Vetter's avatar Daniel Vetter

drm/st7586: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.
Acked-by: default avatarDavid Lechner <david@lechnology.com>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDaniel 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
parent 14877bc7
......@@ -317,18 +317,13 @@ static int st7586_probe(struct spi_device *spi)
size_t bufsize;
int ret;
dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL);
if (!dbidev)
return -ENOMEM;
dbidev = devm_drm_dev_alloc(dev, &st7586_driver,
struct mipi_dbi_dev, drm);
if (IS_ERR(dbidev))
return PTR_ERR(dbidev);
dbi = &dbidev->dbi;
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment