Skip to content

Commit

Permalink
net: tulip: remove unnecessary pci_set_drvdata()
Browse files Browse the repository at this point in the history
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jingoo Han authored and David S. Miller committed Oct 21, 2013
1 parent 5eccdfa commit 3c5b9ca
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 12 deletions.
1 change: 0 additions & 1 deletion drivers/net/ethernet/dec/tulip/de2104x.c
Original file line number Diff line number Diff line change
Expand Up @@ -2110,7 +2110,6 @@ static void de_remove_one(struct pci_dev *pdev)
iounmap(de->regs);
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
free_netdev(dev);
}

Expand Down
3 changes: 0 additions & 3 deletions drivers/net/ethernet/dec/tulip/dmfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ static int dmfe_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
err_out_disable:
pci_disable_device(pdev);
err_out_free:
pci_set_drvdata(pdev, NULL);
free_netdev(dev);

return err;
Expand All @@ -548,8 +547,6 @@ static void dmfe_remove_one(struct pci_dev *pdev)
db->buf_pool_ptr, db->buf_pool_dma_ptr);
pci_release_regions(pdev);
free_netdev(dev); /* free board information */

pci_set_drvdata(pdev, NULL);
}

DMFE_DBUG(0, "dmfe_remove_one() exit", 0);
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/dec/tulip/tulip_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1939,7 +1939,6 @@ static void tulip_remove_one(struct pci_dev *pdev)
pci_iounmap(pdev, tp->base_addr);
free_netdev (dev);
pci_release_regions (pdev);
pci_set_drvdata (pdev, NULL);

/* pci_power_off (pdev, -1); */
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/ethernet/dec/tulip/uli526x.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ static int uli526x_init_one(struct pci_dev *pdev,
err_out_disable:
pci_disable_device(pdev);
err_out_free:
pci_set_drvdata(pdev, NULL);
free_netdev(dev);

return err;
Expand All @@ -450,7 +449,6 @@ static void uli526x_remove_one(struct pci_dev *pdev)
db->buf_pool_ptr, db->buf_pool_dma_ptr);
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
free_netdev(dev);
}

Expand Down
3 changes: 0 additions & 3 deletions drivers/net/ethernet/dec/tulip/winbond-840.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0;

err_out_cleardev:
pci_set_drvdata(pdev, NULL);
pci_iounmap(pdev, ioaddr);
err_out_free_res:
pci_release_regions(pdev);
Expand Down Expand Up @@ -1542,8 +1541,6 @@ static void w840_remove1(struct pci_dev *pdev)
pci_iounmap(pdev, np->base_addr);
free_netdev(dev);
}

pci_set_drvdata(pdev, NULL);
}

#ifdef CONFIG_PM
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/ethernet/dec/tulip/xircom_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err_unmap:
pci_iounmap(pdev, private->ioaddr);
reg_fail:
pci_set_drvdata(pdev, NULL);
dma_free_coherent(d, 8192, private->tx_buffer, private->tx_dma_handle);
tx_buf_fail:
dma_free_coherent(d, 8192, private->rx_buffer, private->rx_dma_handle);
Expand Down Expand Up @@ -317,7 +316,6 @@ static void xircom_remove(struct pci_dev *pdev)

unregister_netdev(dev);
pci_iounmap(pdev, card->ioaddr);
pci_set_drvdata(pdev, NULL);
dma_free_coherent(d, 8192, card->tx_buffer, card->tx_dma_handle);
dma_free_coherent(d, 8192, card->rx_buffer, card->rx_dma_handle);
free_netdev(dev);
Expand Down

0 comments on commit 3c5b9ca

Please sign in to comment.