[1/1] net-next/hinic:add shutdown callback
diff mbox series

Message ID 20190101193933.27361-1-xuechaojing@huawei.com
State Accepted
Delegated to: David Miller
Headers show
Series
  • [1/1] net-next/hinic:add shutdown callback
Related show

Commit Message

Xue Chaojing Jan. 1, 2019, 7:39 p.m. UTC
If there is no shutdown callback, our board will report pcie UNF errors
after restarting. This patch add shutdown callback for hinic.

Signed-off-by: Xue Chaojing <xuechaojing@huawei.com>
---
 drivers/net/ethernet/huawei/hinic/hinic_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

David Miller Jan. 2, 2019, 6:13 p.m. UTC | #1
From: Xue Chaojing <xuechaojing@huawei.com>
Date: Tue, 1 Jan 2019 19:39:33 +0000

> If there is no shutdown callback, our board will report pcie UNF errors
> after restarting. This patch add shutdown callback for hinic.
> 
> Signed-off-by: Xue Chaojing <xuechaojing@huawei.com>

Applied, thanks.

Patch
diff mbox series

diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c
index 6d48dc62a44b..da323b9e1f62 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_main.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c
@@ -1106,6 +1106,11 @@  static void hinic_remove(struct pci_dev *pdev)
 	dev_info(&pdev->dev, "HiNIC driver - removed\n");
 }
 
+static void hinic_shutdown(struct pci_dev *pdev)
+{
+	pci_disable_device(pdev);
+}
+
 static const struct pci_device_id hinic_pci_table[] = {
 	{ PCI_VDEVICE(HUAWEI, HINIC_DEV_ID_QUAD_PORT_25GE), 0},
 	{ PCI_VDEVICE(HUAWEI, HINIC_DEV_ID_DUAL_PORT_25GE), 0},
@@ -1119,6 +1124,7 @@  static struct pci_driver hinic_driver = {
 	.id_table       = hinic_pci_table,
 	.probe          = hinic_probe,
 	.remove         = hinic_remove,
+	.shutdown       = hinic_shutdown,
 };
 
 module_pci_driver(hinic_driver);