Skip to content

Commit

Permalink
ethernet: amd: move amd111e_remove_one after probe
Browse files Browse the repository at this point in the history
This patch moves the remove functionalities after the probe
so that we can see the registered and released resources properly.
Every driver follows the same concept.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Varka Bhadram authored and David S. Miller committed Jul 15, 2014
1 parent 30c9e02 commit 43519e6
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions drivers/net/ethernet/amd/amd8111e.c
Original file line number Diff line number Diff line change
Expand Up @@ -1701,18 +1701,6 @@ static int amd8111e_resume(struct pci_dev *pci_dev)
return 0;
}


static void amd8111e_remove_one(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
if (dev) {
unregister_netdev(dev);
iounmap(((struct amd8111e_priv *)netdev_priv(dev))->mmio);
free_netdev(dev);
pci_release_regions(pdev);
pci_disable_device(pdev);
}
}
static void amd8111e_config_ipg(struct net_device* dev)
{
struct amd8111e_priv *lp = netdev_priv(dev);
Expand Down Expand Up @@ -1970,6 +1958,19 @@ static int amd8111e_probe_one(struct pci_dev *pdev,

}

static void amd8111e_remove_one(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);

if (dev) {
unregister_netdev(dev);
iounmap(((struct amd8111e_priv *)netdev_priv(dev))->mmio);
free_netdev(dev);
pci_release_regions(pdev);
pci_disable_device(pdev);
}
}

static struct pci_driver amd8111e_driver = {
.name = MODULE_NAME,
.id_table = amd8111e_pci_tbl,
Expand Down

0 comments on commit 43519e6

Please sign in to comment.