From 7cbb93d89838bc65f9763fd93bb4b1e6608a9504 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 15 Apr 2020 09:40:32 +0200 Subject: drm/ast: Use managed pci functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows us to remove a bit of cleanup code. Reviewed-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Thomas Zimmermann Cc: Gerd Hoffmann Cc: Daniel Vetter Cc: Emil Velikov Cc: "Noralf Trønnes" Cc: Sam Ravnborg Cc: "Christian König" Cc: "Y.C. Chen" Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-58-daniel.vetter@ffwll.ch --- drivers/gpu/drm/ast/ast_drv.c | 10 +++------- drivers/gpu/drm/ast/ast_main.c | 3 --- 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'drivers/gpu/drm/ast') diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c index b7ba22dddcad..48a9cc4e080a 100644 --- a/drivers/gpu/drm/ast/ast_drv.c +++ b/drivers/gpu/drm/ast/ast_drv.c @@ -91,15 +91,13 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ast_kick_out_firmware_fb(pdev); - ret = pci_enable_device(pdev); + ret = pcim_enable_device(pdev); if (ret) return ret; dev = drm_dev_alloc(&driver, &pdev->dev); - if (IS_ERR(dev)) { - ret = PTR_ERR(dev); - goto err_pci_disable_device; - } + if (IS_ERR(dev)) + return PTR_ERR(dev); dev->pdev = pdev; pci_set_drvdata(pdev, dev); @@ -120,8 +118,6 @@ err_ast_driver_unload: ast_driver_unload(dev); err_drm_dev_put: drm_dev_put(dev); -err_pci_disable_device: - pci_disable_device(pdev); return ret; } diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index e5398e3dabe7..1b35728ad871 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -531,8 +531,5 @@ void ast_driver_unload(struct drm_device *dev) drm_mode_config_cleanup(dev); ast_mm_fini(ast); - if (ast->ioregs != ast->regs + AST_IO_MM_OFFSET) - pci_iounmap(dev->pdev, ast->ioregs); - pci_iounmap(dev->pdev, ast->regs); kfree(ast); } -- cgit v1.2.3