From: Daniel Vetter Date: Wed, 15 Apr 2020 07:39:49 +0000 (+0200) Subject: drm/st7586: Use devm_drm_dev_alloc X-Git-Tag: baikal/mips/sdk5.9~13559^2~13^2~62 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=7eb9cc7d0ca1db289ca0dce590e0a72ca23dc65b;p=kernel.git drm/st7586: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: David Lechner Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-15-daniel.vetter@ffwll.ch --- diff --git a/drivers/gpu/drm/tiny/st7586.c b/drivers/gpu/drm/tiny/st7586.c index c3295c717ba68..2a1fae422f7a2 100644 --- a/drivers/gpu/drm/tiny/st7586.c +++ b/drivers/gpu/drm/tiny/st7586.c @@ -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;