Skip to content

Commit

Permalink
net: thunderx: 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: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Aug 15, 2016
1 parent 6e22066 commit 5288b6f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/net/ethernet/cavium/thunder/thunder_xcv.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ static int xcv_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
err_disable_device:
pci_disable_device(pdev);
err_kfree:
pci_set_drvdata(pdev, NULL);
devm_kfree(dev, xcv);
xcv = NULL;
return err;
Expand All @@ -211,7 +210,6 @@ static void xcv_remove(struct pci_dev *pdev)

pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}

static struct pci_driver xcv_driver = {
Expand Down

0 comments on commit 5288b6f

Please sign in to comment.