mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-31 00:17:44 +00:00
drm/hisilicon: 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: Tian Tao <tiantao6@hisilicon.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1608511522-3100-1-git-send-email-tiantao6@hisilicon.com
This commit is contained in:
parent
b39100a55c
commit
4c5d02d94c
1 changed files with 2 additions and 4 deletions
|
@ -329,7 +329,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
|
||||||
dev->pdev = pdev;
|
dev->pdev = pdev;
|
||||||
pci_set_drvdata(pdev, dev);
|
pci_set_drvdata(pdev, dev);
|
||||||
|
|
||||||
ret = pci_enable_device(pdev);
|
ret = pcim_enable_device(pdev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_err(dev, "failed to enable pci device: %d\n", ret);
|
drm_err(dev, "failed to enable pci device: %d\n", ret);
|
||||||
goto err_free;
|
goto err_free;
|
||||||
|
@ -338,7 +338,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
|
||||||
ret = hibmc_load(dev);
|
ret = hibmc_load(dev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_err(dev, "failed to load hibmc: %d\n", ret);
|
drm_err(dev, "failed to load hibmc: %d\n", ret);
|
||||||
goto err_disable;
|
goto err_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = drm_dev_register(dev, 0);
|
ret = drm_dev_register(dev, 0);
|
||||||
|
@ -354,8 +354,6 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
|
||||||
|
|
||||||
err_unload:
|
err_unload:
|
||||||
hibmc_unload(dev);
|
hibmc_unload(dev);
|
||||||
err_disable:
|
|
||||||
pci_disable_device(pdev);
|
|
||||||
err_free:
|
err_free:
|
||||||
drm_dev_put(dev);
|
drm_dev_put(dev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue