提交 baf785ba 编写于 作者: D David S. Miller

Merge branch 'pci_set_drvdata'

Jingoo Han says:

====================
net: ethernet: remove unnecessary pci_set_drvdata() part 1

Since commit 0998d063
(device-core: Ensure drvdata = NULL when no driver is bound),
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: NDavid S. Miller <davem@davemloft.net>
......@@ -2525,7 +2525,6 @@ typhoon_remove_one(struct pci_dev *pdev)
pci_release_regions(pdev);
pci_clear_mwi(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
free_netdev(dev);
}
......
......@@ -389,9 +389,7 @@ static int ne2k_pci_init_one(struct pci_dev *pdev,
free_netdev (dev);
err_out_free_res:
release_region (ioaddr, NE_IO_EXTENT);
pci_set_drvdata (pdev, NULL);
return -ENODEV;
}
/*
......@@ -655,7 +653,6 @@ static void ne2k_pci_remove_one(struct pci_dev *pdev)
release_region(dev->base_addr, NE_IO_EXTENT);
free_netdev(dev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}
#ifdef CONFIG_PM
......
......@@ -835,7 +835,6 @@ static int starfire_init_one(struct pci_dev *pdev,
return 0;
err_out_cleardev:
pci_set_drvdata(pdev, NULL);
iounmap(base);
err_out_free_res:
pci_release_regions (pdev);
......@@ -2012,7 +2011,6 @@ static void starfire_remove_one(struct pci_dev *pdev)
iounmap(np->base);
pci_release_regions(pdev);
pci_set_drvdata(pdev, NULL);
free_netdev(dev); /* Will also free np!! */
}
......
......@@ -1711,7 +1711,6 @@ static void amd8111e_remove_one(struct pci_dev *pdev)
free_netdev(dev);
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}
}
static void amd8111e_config_ipg(struct net_device* dev)
......@@ -1967,7 +1966,6 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
err_disable_pdev:
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
return err;
}
......
......@@ -2818,7 +2818,6 @@ static void pcnet32_remove_one(struct pci_dev *pdev)
lp->init_block, lp->init_dma_addr);
free_netdev(dev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}
}
......
......@@ -1367,7 +1367,6 @@ static void alx_remove(struct pci_dev *pdev)
pci_disable_pcie_error_reporting(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
free_netdev(alx->dev);
}
......
......@@ -8413,7 +8413,6 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
err_out_disable:
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
err_out:
return rc;
......@@ -8546,7 +8545,6 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_iounmap(pdev, bp->regview);
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
err_free:
free_netdev(dev);
return rc;
......@@ -8578,7 +8576,6 @@ bnx2_remove_one(struct pci_dev *pdev)
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}
static int
......
......@@ -12297,7 +12297,6 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
err_out_disable:
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
err_out:
return rc;
......@@ -12840,7 +12839,6 @@ static int bnx2x_init_one(struct pci_dev *pdev,
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
return rc;
}
......@@ -12923,7 +12921,6 @@ static void __bnx2x_remove(struct pci_dev *pdev,
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}
static void bnx2x_remove_one(struct pci_dev *pdev)
......
......@@ -17701,7 +17701,6 @@ static int tg3_init_one(struct pci_dev *pdev,
err_out_disable_pdev:
if (pci_is_enabled(pdev))
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
return err;
}
......@@ -17733,7 +17732,6 @@ static void tg3_remove_one(struct pci_dev *pdev)
free_netdev(dev);
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}
}
......
......@@ -3212,7 +3212,6 @@ bnad_init(struct bnad *bnad,
bnad->bar0 = ioremap_nocache(bnad->mmio_start, bnad->mmio_len);
if (!bnad->bar0) {
dev_err(&pdev->dev, "ioremap for bar0 failed\n");
pci_set_drvdata(pdev, NULL);
return -ENOMEM;
}
pr_info("bar0 mapped to %p, len %llu\n", bnad->bar0,
......
......@@ -1168,7 +1168,6 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_release_regions(pdev);
out_disable_pdev:
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
return err;
}
......@@ -1347,7 +1346,6 @@ static void remove_one(struct pci_dev *pdev)
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
t1_sw_reset(pdev);
}
......
......@@ -3374,7 +3374,6 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_release_regions(pdev);
out_disable_device:
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
out:
return err;
}
......@@ -3415,7 +3414,6 @@ static void remove_one(struct pci_dev *pdev)
kfree(adapter);
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}
}
......
......@@ -6075,7 +6075,6 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_disable_device(pdev);
out_release_regions:
pci_release_regions(pdev);
pci_set_drvdata(pdev, NULL);
return err;
}
......@@ -6123,7 +6122,6 @@ static void remove_one(struct pci_dev *pdev)
pci_disable_pcie_error_reporting(pdev);
pci_disable_device(pdev);
pci_release_regions(pdev);
pci_set_drvdata(pdev, NULL);
} else
pci_release_regions(pdev);
}
......
......@@ -2782,11 +2782,9 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,
err_free_adapter:
kfree(adapter);
pci_set_drvdata(pdev, NULL);
err_release_regions:
pci_release_regions(pdev);
pci_set_drvdata(pdev, NULL);
pci_clear_master(pdev);
err_disable_device:
......@@ -2851,7 +2849,6 @@ static void cxgb4vf_pci_remove(struct pci_dev *pdev)
}
iounmap(adapter->regs);
kfree(adapter);
pci_set_drvdata(pdev, NULL);
}
/*
......
......@@ -2309,7 +2309,6 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
err_out_disable_device:
pci_disable_device(pdev);
err_out_free_netdev:
pci_set_drvdata(pdev, NULL);
free_netdev(netdev);
return err;
......@@ -2338,7 +2337,6 @@ static void enic_remove(struct pci_dev *pdev)
enic_iounmap(enic);
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
free_netdev(netdev);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册