2020-03-06 03:44:42

by Tian Tao

[permalink] [raw]
Subject: [PATCH] drm/hisilicon: Add the shutdown for hibmc_pci_driver

add the shutdown function to release the resource.

Signed-off-by: Tian Tao <[email protected]>
---
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 51f1c70..0e58455d 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -357,9 +357,14 @@ static void hibmc_pci_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);

- drm_dev_unregister(dev);
- hibmc_unload(dev);
drm_dev_put(dev);
+ pci_disable_device(pdev);
+
+}
+
+static void hibmc_pci_shutdown(struct pci_dev *pdev)
+{
+ hibmc_pci_remove(pdev);
}

static struct pci_device_id hibmc_pci_table[] = {
@@ -372,6 +377,7 @@ static struct pci_driver hibmc_pci_driver = {
.id_table = hibmc_pci_table,
.probe = hibmc_pci_probe,
.remove = hibmc_pci_remove,
+ .shutdown = hibmc_pci_shutdown,
.driver.pm = &hibmc_pm_ops,
};

--
2.7.4


2020-03-06 03:59:31

by Tian Tao

[permalink] [raw]
Subject: 答复: [PATCH] drm/hisilicon: Add the shutdown for hibmc_pci_driver

Hi All??

Sorry??please ignore this patch.

Best

-----?ʼ?ԭ??-----
??????: Linuxarm [mailto:[email protected]] ???? Tian Tao
????ʱ??: 2020??3??6?? 11:43
?ռ???: Chenfeng (puck) <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
????: Linuxarm <[email protected]>
????: [PATCH] drm/hisilicon: Add the shutdown for hibmc_pci_driver

add the shutdown function to release the resource.

Signed-off-by: Tian Tao <[email protected]>
---
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 51f1c70..0e58455d 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -357,9 +357,14 @@ static void hibmc_pci_remove(struct pci_dev *pdev) {
struct drm_device *dev = pci_get_drvdata(pdev);

- drm_dev_unregister(dev);
- hibmc_unload(dev);
drm_dev_put(dev);
+ pci_disable_device(pdev);
+
+}
+
+static void hibmc_pci_shutdown(struct pci_dev *pdev) {
+ hibmc_pci_remove(pdev);
}

static struct pci_device_id hibmc_pci_table[] = { @@ -372,6 +377,7 @@ static struct pci_driver hibmc_pci_driver = {
.id_table = hibmc_pci_table,
.probe = hibmc_pci_probe,
.remove = hibmc_pci_remove,
+ .shutdown = hibmc_pci_shutdown,
.driver.pm = &hibmc_pm_ops,
};

--
2.7.4

_______________________________________________
Linuxarm mailing list
[email protected]
http://hulk.huawei.com/mailman/listinfo/linuxarm