From: Daniel Vetter Date: Wed, 15 Apr 2020 07:40:05 +0000 (+0200) Subject: drm/ingenic: Use devm_drm_dev_alloc X-Git-Tag: baikal/mips/sdk5.9~13559^2~13^2~48 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=675831d0a981e9c5b6a9f951ee1fe49d05d5e079;p=kernel.git drm/ingenic: Use devm_drm_dev_alloc Already using devm_drm_dev_init, so very simple replacment. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-31-daniel.vetter@ffwll.ch --- diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c index 24cc3587cea5d..2dd1f3020fcb7 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c @@ -611,9 +611,10 @@ static int ingenic_drm_probe(struct platform_device *pdev) return -EINVAL; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; + priv = devm_drm_dev_alloc(dev, &ingenic_drm_driver_data, + struct ingenic_drm, drm); + if (IS_ERR(priv)) + return PTR_ERR(priv); priv->soc_info = soc_info; priv->dev = dev; @@ -622,13 +623,6 @@ static int ingenic_drm_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); - ret = devm_drm_dev_init(dev, drm, &ingenic_drm_driver_data); - if (ret) { - kfree(priv); - return ret; - } - drmm_add_final_kfree(drm, priv); - ret = drmm_mode_config_init(drm); if (ret) return ret;