Commit 2df94510 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/gma500: Disable PCI device during shutdown

Use managed disablement of PCI devices via pcim_device_enable().
Disables the PCI device and simplifies error rollback in probe
function.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210920141051.30988-3-tzimmermann@suse.de
parent f71635e8
...@@ -448,15 +448,13 @@ static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -448,15 +448,13 @@ static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct drm_device *dev; struct drm_device *dev;
int ret; int ret;
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;
}
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
...@@ -474,8 +472,6 @@ static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -474,8 +472,6 @@ static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
psb_driver_unload(dev); psb_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