Commit 6ff71edf authored by Daniel Vetter's avatar Daniel Vetter

drm/mcde: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

v2: Move misplaced double-assignement to next patch (Sam)
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-29-daniel.vetter@ffwll.ch
parent 39270370
...@@ -307,19 +307,12 @@ static int mcde_probe(struct platform_device *pdev) ...@@ -307,19 +307,12 @@ static int mcde_probe(struct platform_device *pdev)
int ret; int ret;
int i; int i;
mcde = kzalloc(sizeof(*mcde), GFP_KERNEL); mcde = devm_drm_dev_alloc(dev, &mcde_drm_driver, struct mcde, drm);
if (!mcde) if (IS_ERR(mcde))
return -ENOMEM; return PTR_ERR(mcde);
mcde->dev = dev;
ret = devm_drm_dev_init(dev, &mcde->drm, &mcde_drm_driver);
if (ret) {
kfree(mcde);
return ret;
}
drm = &mcde->drm; drm = &mcde->drm;
drm->dev_private = mcde; drm->dev_private = mcde;
drmm_add_final_kfree(drm, mcde); mcde->dev = dev;
platform_set_drvdata(pdev, drm); platform_set_drvdata(pdev, drm);
/* Enable continuous updates: this is what Linux' framebuffer expects */ /* Enable continuous updates: this is what Linux' framebuffer expects */
......
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