aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <[email protected]>2020-04-15 09:40:10 +0200
committerDaniel Vetter <[email protected]>2020-04-28 16:04:32 +0200
commit9bb2e63705a1a1cacd05b094b7fd9a1b28fa00f2 (patch)
tree8ea3e66c4053def94a19357a7fa6e68f2718b7d6
parent843ef624a491fabc3f0829c341a33fc4cc008000 (diff)
drm/cirrus: Use devm_drm_dev_alloc
Already using devm_drm_dev_init, so very simple replacment. Acked-by: Noralf Trønnes <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Gerd Hoffmann <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: "Noralf Trønnes" <[email protected]> Cc: Rob Herring <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: [email protected] Cc: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/cirrus/cirrus.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
index a36269717c3b..4b65637147ba 100644
--- a/drivers/gpu/drm/cirrus/cirrus.c
+++ b/drivers/gpu/drm/cirrus/cirrus.c
@@ -567,18 +567,13 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
return ret;
ret = -ENOMEM;
- cirrus = kzalloc(sizeof(*cirrus), GFP_KERNEL);
- if (cirrus == NULL)
- return ret;
+ cirrus = devm_drm_dev_alloc(&pdev->dev, &cirrus_driver,
+ struct cirrus_device, dev);
+ if (IS_ERR(cirrus))
+ return PTR_ERR(cirrus);
dev = &cirrus->dev;
- ret = devm_drm_dev_init(&pdev->dev, dev, &cirrus_driver);
- if (ret) {
- kfree(cirrus);
- return ret;
- }
dev->dev_private = cirrus;
- drmm_add_final_kfree(dev, cirrus);
cirrus->vram = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));