netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: fealnx: fix missing pci_disable_device()
@ 2022-10-24 13:57 Yang Yingliang
  2022-10-25  6:42 ` Leon Romanovsky
  2022-10-25  7:47 ` Leon Romanovsky
  0 siblings, 2 replies; 7+ messages in thread
From: Yang Yingliang @ 2022-10-24 13:57 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba

pci_disable_device() need be called while module exiting, switch
to use pcim_enable(), pci_disable_device() and pci_release_regions()
will be called in pcim_release() while unbinding device.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/ethernet/fealnx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/fealnx.c b/drivers/net/ethernet/fealnx.c
index ed18450fd2cc..fb139f295b67 100644
--- a/drivers/net/ethernet/fealnx.c
+++ b/drivers/net/ethernet/fealnx.c
@@ -494,7 +494,7 @@ static int fealnx_init_one(struct pci_dev *pdev,
 
 	option = card_idx < MAX_UNITS ? options[card_idx] : 0;
 
-	i = pci_enable_device(pdev);
+	i = pcim_enable_device(pdev);
 	if (i) return i;
 	pci_set_master(pdev);
 
@@ -670,7 +670,6 @@ static int fealnx_init_one(struct pci_dev *pdev,
 err_out_unmap:
 	pci_iounmap(pdev, ioaddr);
 err_out_res:
-	pci_release_regions(pdev);
 	return err;
 }
 
@@ -689,7 +688,6 @@ static void fealnx_remove_one(struct pci_dev *pdev)
 		unregister_netdev(dev);
 		pci_iounmap(pdev, np->mem);
 		free_netdev(dev);
-		pci_release_regions(pdev);
 	} else
 		printk(KERN_ERR "fealnx: remove for unknown device\n");
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-25 11:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-24 13:57 [PATCH net] net: fealnx: fix missing pci_disable_device() Yang Yingliang
2022-10-25  6:42 ` Leon Romanovsky
2022-10-25  7:47 ` Leon Romanovsky
2022-10-25  9:01   ` Yang Yingliang
2022-10-25 10:27     ` Leon Romanovsky
2022-10-25 11:25       ` Yang Yingliang
2022-10-25 11:48         ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).