Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: hibmcge: support pci_driver.shutdown()

support pci_driver.shutdown() for hibmcge driver.

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Link: https://patch.msgid.link/20251014134018.1178385-1-shaojijie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jijie Shao and committed by
Jakub Kicinski
0746da01 7e0d4c11

+17
+17
drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c
··· 472 472 return 0; 473 473 } 474 474 475 + static void hbg_shutdown(struct pci_dev *pdev) 476 + { 477 + struct net_device *netdev = pci_get_drvdata(pdev); 478 + 479 + rtnl_lock(); 480 + if (netif_running(netdev)) 481 + dev_close(netdev); 482 + rtnl_unlock(); 483 + 484 + pci_disable_device(pdev); 485 + pci_set_drvdata(pdev, NULL); 486 + 487 + if (system_state == SYSTEM_POWER_OFF) 488 + pci_set_power_state(pdev, PCI_D3hot); 489 + } 490 + 475 491 static const struct pci_device_id hbg_pci_tbl[] = { 476 492 {PCI_VDEVICE(HUAWEI, 0x3730), 0}, 477 493 { } ··· 498 482 .name = "hibmcge", 499 483 .id_table = hbg_pci_tbl, 500 484 .probe = hbg_probe, 485 + .shutdown = hbg_shutdown, 501 486 }; 502 487 503 488 static int __init hbg_module_init(void)