mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 13:41:48 -04:00
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>
This commit is contained in:
committed by
Jakub Kicinski
parent
7e0d4c1113
commit
0746da0176
@@ -472,6 +472,22 @@ static int hbg_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void hbg_shutdown(struct pci_dev *pdev)
|
||||
{
|
||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||
|
||||
rtnl_lock();
|
||||
if (netif_running(netdev))
|
||||
dev_close(netdev);
|
||||
rtnl_unlock();
|
||||
|
||||
pci_disable_device(pdev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
|
||||
if (system_state == SYSTEM_POWER_OFF)
|
||||
pci_set_power_state(pdev, PCI_D3hot);
|
||||
}
|
||||
|
||||
static const struct pci_device_id hbg_pci_tbl[] = {
|
||||
{PCI_VDEVICE(HUAWEI, 0x3730), 0},
|
||||
{ }
|
||||
@@ -482,6 +498,7 @@ static struct pci_driver hbg_driver = {
|
||||
.name = "hibmcge",
|
||||
.id_table = hbg_pci_tbl,
|
||||
.probe = hbg_probe,
|
||||
.shutdown = hbg_shutdown,
|
||||
};
|
||||
|
||||
static int __init hbg_module_init(void)
|
||||
|
||||
Reference in New Issue
Block a user