summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/hisilicon
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2020-12-21 03:45:22 +0300
committerTian Tao <tiantao6@hisilicon.com>2020-12-23 06:30:44 +0300
commit4c5d02d94c4dfc85ebbed03da9c08a7e358ebb2a (patch)
treea077b3ed3f67af74c1b1c39c7f808e651b27c6be /drivers/gpu/drm/hisilicon
parentb39100a55ceab858daa35f03e227b54a03cc11ee (diff)
downloadlinux-4c5d02d94c4dfc85ebbed03da9c08a7e358ebb2a.tar.xz
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
Diffstat (limited to 'drivers/gpu/drm/hisilicon')
-rw-r--r--drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 02f3bd158c86..7159018b7287 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -329,7 +329,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
dev->pdev = pdev;
pci_set_drvdata(pdev, dev);
- ret = pci_enable_device(pdev);
+ ret = pcim_enable_device(pdev);
if (ret) {
drm_err(dev, "failed to enable pci device: %d\n", ret);
goto err_free;
@@ -338,7 +338,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
ret = hibmc_load(dev);
if (ret) {
drm_err(dev, "failed to load hibmc: %d\n", ret);
- goto err_disable;
+ goto err_free;
}
ret = drm_dev_register(dev, 0);
@@ -354,8 +354,6 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
err_unload:
hibmc_unload(dev);
-err_disable:
- pci_disable_device(pdev);
err_free:
drm_dev_put(dev);