Commit 044e0935 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/mgag200: Use pcim_enable_device()

Using the managed function simplifies the error handling. After
unloading the driver, the PCI device should now get disabled as
well.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200605135803.19811-4-tzimmermann@suse.de
parent 91c4dc57
...@@ -52,15 +52,13 @@ static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -52,15 +52,13 @@ static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "mgag200drmfb"); drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "mgag200drmfb");
ret = pci_enable_device(pdev); ret = pcim_enable_device(pdev);
if (ret) if (ret)
return ret; return ret;
dev = drm_dev_alloc(&driver, &pdev->dev); dev = drm_dev_alloc(&driver, &pdev->dev);
if (IS_ERR(dev)) { if (IS_ERR(dev))
ret = PTR_ERR(dev); return PTR_ERR(dev);
goto err_pci_disable_device;
}
dev->pdev = pdev; dev->pdev = pdev;
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
...@@ -81,8 +79,6 @@ static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -81,8 +79,6 @@ static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
mgag200_driver_unload(dev); mgag200_driver_unload(dev);
err_drm_dev_put: err_drm_dev_put:
drm_dev_put(dev); drm_dev_put(dev);
err_pci_disable_device:
pci_disable_device(pdev);
return ret; return ret;
} }
......
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