Commit 37d8d81f authored by Daniel Vetter's avatar Daniel Vetter

drm/ingenic: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Cc: Paul Cercueil <paul@crapouillou.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-31-daniel.vetter@ffwll.ch
parent fd7ee85c
...@@ -611,9 +611,10 @@ static int ingenic_drm_probe(struct platform_device *pdev) ...@@ -611,9 +611,10 @@ static int ingenic_drm_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
priv = kzalloc(sizeof(*priv), GFP_KERNEL); priv = devm_drm_dev_alloc(dev, &ingenic_drm_driver_data,
if (!priv) struct ingenic_drm, drm);
return -ENOMEM; if (IS_ERR(priv))
return PTR_ERR(priv);
priv->soc_info = soc_info; priv->soc_info = soc_info;
priv->dev = dev; priv->dev = dev;
...@@ -622,13 +623,6 @@ static int ingenic_drm_probe(struct platform_device *pdev) ...@@ -622,13 +623,6 @@ static int ingenic_drm_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, priv); 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); ret = drmm_mode_config_init(drm);
if (ret) if (ret)
return ret; return ret;
......
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