Commit b3b13400 authored by Daniel Vetter's avatar Daniel Vetter

drm/tidss: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.
Tested-by: default avatarJyri Sarha <jsarha@ti.com>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Cc: Jyri Sarha <jsarha@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-24-daniel.vetter@ffwll.ch
parent 7ced4801
...@@ -135,20 +135,13 @@ static int tidss_probe(struct platform_device *pdev) ...@@ -135,20 +135,13 @@ static int tidss_probe(struct platform_device *pdev)
dev_dbg(dev, "%s\n", __func__); dev_dbg(dev, "%s\n", __func__);
/* Can't use devm_* since drm_device's lifetime may exceed dev's */ tidss = devm_drm_dev_alloc(&pdev->dev, &tidss_driver,
tidss = kzalloc(sizeof(*tidss), GFP_KERNEL); struct tidss_device, ddev);
if (!tidss) if (IS_ERR(tidss))
return -ENOMEM; return PTR_ERR(tidss);
ddev = &tidss->ddev; ddev = &tidss->ddev;
ret = devm_drm_dev_init(&pdev->dev, ddev, &tidss_driver);
if (ret) {
kfree(ddev);
return ret;
}
drmm_add_final_kfree(ddev, tidss);
tidss->dev = dev; tidss->dev = dev;
tidss->feat = of_device_get_match_data(dev); tidss->feat = of_device_get_match_data(dev);
......
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