OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b39100a
)
drm/hisilicon: Use pcim_enable_device()
author
Tian Tao
<tiantao6@hisilicon.com>
Mon, 21 Dec 2020 00:45:22 +0000
(08:45 +0800)
committer
Tian Tao
<tiantao6@hisilicon.com>
Wed, 23 Dec 2020 03:30:44 +0000
(22:30 -0500)
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
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index
02f3bd1
..
7159018
100644
(file)
--- 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 = pci
m
_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_
disabl
e;
+ goto err_
fre
e;
}
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);