From: Daniel Vetter Date: Wed, 15 Apr 2020 07:39:55 +0000 (+0200) Subject: drm/hx8357d: Use devm_drm_dev_alloc X-Git-Tag: baikal/mips/sdk5.9~13559^2~13^2~56 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=e420284ab6bf51a1827d632d2e9568c8d769537d;p=kernel.git drm/hx8357d: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: Eric Anholt Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-21-daniel.vetter@ffwll.ch --- diff --git a/drivers/gpu/drm/tiny/hx8357d.c b/drivers/gpu/drm/tiny/hx8357d.c index af7f3d10aac33..b4bc358a3269a 100644 --- a/drivers/gpu/drm/tiny/hx8357d.c +++ b/drivers/gpu/drm/tiny/hx8357d.c @@ -226,17 +226,12 @@ static int hx8357d_probe(struct spi_device *spi) u32 rotation = 0; int ret; - dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL); - if (!dbidev) - return -ENOMEM; + dbidev = devm_drm_dev_alloc(dev, &hx8357d_driver, + struct mipi_dbi_dev, drm); + if (IS_ERR(dbidev)) + return PTR_ERR(dbidev); drm = &dbidev->drm; - ret = devm_drm_dev_init(dev, drm, &hx8357d_driver); - if (ret) { - kfree(dbidev); - return ret; - } - drmm_add_final_kfree(drm, dbidev); dc = devm_gpiod_get(dev, "dc", GPIOD_OUT_LOW); if (IS_ERR(dc)) {