summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mcde/mcde_drv.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2020-04-15 10:40:03 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2020-04-28 17:03:16 +0300
commit6ff71edfcb0be37c803da51e1b893809ead22203 (patch)
tree6ed6ad0cd1a929442f47569201c1c9c1af7e429d /drivers/gpu/drm/mcde/mcde_drv.c
parent3927037003f97fc0e57a6804e95bb186e3d22194 (diff)
downloadlinux-6ff71edfcb0be37c803da51e1b893809ead22203.tar.xz
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: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Daniel 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
Diffstat (limited to 'drivers/gpu/drm/mcde/mcde_drv.c')
-rw-r--r--drivers/gpu/drm/mcde/mcde_drv.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index 88cc6b4a7a64..22003478db2c 100644
--- a/drivers/gpu/drm/mcde/mcde_drv.c
+++ b/drivers/gpu/drm/mcde/mcde_drv.c
@@ -307,19 +307,12 @@ static int mcde_probe(struct platform_device *pdev)
int ret;
int i;
- mcde = kzalloc(sizeof(*mcde), GFP_KERNEL);
- if (!mcde)
- return -ENOMEM;
- mcde->dev = dev;
-
- ret = devm_drm_dev_init(dev, &mcde->drm, &mcde_drm_driver);
- if (ret) {
- kfree(mcde);
- return ret;
- }
+ mcde = devm_drm_dev_alloc(dev, &mcde_drm_driver, struct mcde, drm);
+ if (IS_ERR(mcde))
+ return PTR_ERR(mcde);
drm = &mcde->drm;
drm->dev_private = mcde;
- drmm_add_final_kfree(drm, mcde);
+ mcde->dev = dev;
platform_set_drvdata(pdev, drm);
/* Enable continuous updates: this is what Linux' framebuffer expects */