mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 08:25:39 +07:00
drm/mcde: More devm_drm_dev_init
Auto-unwind ftw, now possible with the fixed drm_device related management. Aside, clk/regulator seem to be missing devm versions for a bunch of functions, preventing a pile of these simpler drivers from outright losing their ->remove hook. 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/20200323144950.3018436-34-daniel.vetter@ffwll.ch
This commit is contained in:
parent
4b055ab137
commit
90c2e13bc3
@ -312,7 +312,7 @@ static int mcde_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
mcde->dev = dev;
|
||||
|
||||
ret = drm_dev_init(&mcde->drm, &mcde_drm_driver, dev);
|
||||
ret = devm_drm_dev_init(dev, &mcde->drm, &mcde_drm_driver);
|
||||
if (ret) {
|
||||
kfree(mcde);
|
||||
return ret;
|
||||
@ -331,12 +331,12 @@ static int mcde_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(mcde->epod)) {
|
||||
ret = PTR_ERR(mcde->epod);
|
||||
dev_err(dev, "can't get EPOD regulator\n");
|
||||
goto dev_unref;
|
||||
return ret;
|
||||
}
|
||||
ret = regulator_enable(mcde->epod);
|
||||
if (ret) {
|
||||
dev_err(dev, "can't enable EPOD regulator\n");
|
||||
goto dev_unref;
|
||||
return ret;
|
||||
}
|
||||
mcde->vana = devm_regulator_get(dev, "vana");
|
||||
if (IS_ERR(mcde->vana)) {
|
||||
@ -487,8 +487,6 @@ static int mcde_probe(struct platform_device *pdev)
|
||||
regulator_disable(mcde->vana);
|
||||
regulator_epod_off:
|
||||
regulator_disable(mcde->epod);
|
||||
dev_unref:
|
||||
drm_dev_put(drm);
|
||||
return ret;
|
||||
|
||||
}
|
||||
@ -502,7 +500,6 @@ static int mcde_remove(struct platform_device *pdev)
|
||||
clk_disable_unprepare(mcde->mcde_clk);
|
||||
regulator_disable(mcde->vana);
|
||||
regulator_disable(mcde->epod);
|
||||
drm_dev_put(drm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user