diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2020-06-05 15:57:52 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2020-06-11 10:05:34 +0200 |
commit | 044e0935559bf2f6ee1cef757d779fdebc87c37b (patch) | |
tree | 8195e0b34b48546c676d6638f05f8174d8a0b092 /drivers/gpu/drm/mgag200 | |
parent | 91c4dc5787739d64f257028973dcd9b41f8e55fb (diff) | |
download | linux-044e0935559bf2f6ee1cef757d779fdebc87c37b.tar.bz2 |
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: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200605135803.19811-4-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/mgag200')
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_drv.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c index 00ddea7d7d27..140ae86082c8 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.c +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -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"); - 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); @@ -81,8 +79,6 @@ err_mgag200_driver_unload: mgag200_driver_unload(dev); err_drm_dev_put: drm_dev_put(dev); -err_pci_disable_device: - pci_disable_device(pdev); return ret; } |