mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
Merge branch 'pci_set_drvdata'
Jingoo Han says:
====================
net: ethernet: remove unnecessary pci_set_drvdata() part 2
Since commit 0998d06310
(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: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
3167fe98ce
@ -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);
|
||||
}
|
||||
|
||||
|
@ -523,7 +523,6 @@ err_out_res:
|
||||
err_out_disable:
|
||||
pci_disable_device(pdev);
|
||||
err_out_free:
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
free_netdev(dev);
|
||||
|
||||
return err;
|
||||
@ -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);
|
||||
|
@ -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); */
|
||||
}
|
||||
|
@ -429,7 +429,6 @@ err_out_release:
|
||||
err_out_disable:
|
||||
pci_disable_device(pdev);
|
||||
err_out_free:
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
free_netdev(dev);
|
||||
|
||||
return err;
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
@ -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
|
||||
|
@ -289,7 +289,6 @@ out:
|
||||
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);
|
||||
@ -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);
|
||||
|
@ -1746,7 +1746,6 @@ rio_remove1 (struct pci_dev *pdev)
|
||||
pci_release_regions (pdev);
|
||||
pci_disable_device (pdev);
|
||||
}
|
||||
pci_set_drvdata (pdev, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver rio_driver = {
|
||||
|
@ -703,7 +703,6 @@ err_out_unmap_tx:
|
||||
dma_free_coherent(&pdev->dev, TX_TOTAL_SIZE,
|
||||
np->tx_ring, np->tx_ring_dma);
|
||||
err_out_cleardev:
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
pci_iounmap(pdev, ioaddr);
|
||||
err_out_res:
|
||||
pci_release_regions(pdev);
|
||||
@ -1941,7 +1940,6 @@ static void sundance_remove1(struct pci_dev *pdev)
|
||||
pci_iounmap(pdev, np->base);
|
||||
pci_release_regions(pdev);
|
||||
free_netdev(dev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4204,7 +4204,6 @@ static void be_remove(struct pci_dev *pdev)
|
||||
|
||||
pci_disable_pcie_error_reporting(pdev);
|
||||
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
pci_release_regions(pdev);
|
||||
pci_disable_device(pdev);
|
||||
|
||||
@ -4534,7 +4533,6 @@ ctrl_clean:
|
||||
be_ctrl_cleanup(adapter);
|
||||
free_netdev:
|
||||
free_netdev(netdev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
rel_reg:
|
||||
pci_release_regions(pdev);
|
||||
disable_dev:
|
||||
|
@ -699,7 +699,6 @@ static void fealnx_remove_one(struct pci_dev *pdev)
|
||||
pci_iounmap(pdev, np->mem);
|
||||
free_netdev(dev);
|
||||
pci_release_regions(pdev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
} else
|
||||
printk(KERN_ERR "fealnx: remove for unknown device\n");
|
||||
}
|
||||
|
@ -2183,7 +2183,6 @@ static void ipg_remove(struct pci_dev *pdev)
|
||||
|
||||
free_netdev(dev);
|
||||
pci_disable_device(pdev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static const struct net_device_ops ipg_netdev_ops = {
|
||||
|
@ -2985,7 +2985,6 @@ err_out_free_res:
|
||||
err_out_disable_pdev:
|
||||
pci_disable_device(pdev);
|
||||
err_out_free_dev:
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
free_netdev(netdev);
|
||||
return err;
|
||||
}
|
||||
@ -3003,7 +3002,6 @@ static void e100_remove(struct pci_dev *pdev)
|
||||
free_netdev(netdev);
|
||||
pci_release_regions(pdev);
|
||||
pci_disable_device(pdev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3192,7 +3192,6 @@ jme_init_one(struct pci_dev *pdev,
|
||||
err_out_unmap:
|
||||
iounmap(jme->regs);
|
||||
err_out_free_netdev:
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
free_netdev(netdev);
|
||||
err_out_release_regions:
|
||||
pci_release_regions(pdev);
|
||||
@ -3210,7 +3209,6 @@ jme_remove_one(struct pci_dev *pdev)
|
||||
|
||||
unregister_netdev(netdev);
|
||||
iounmap(jme->regs);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
free_netdev(netdev);
|
||||
pci_release_regions(pdev);
|
||||
pci_disable_device(pdev);
|
||||
|
@ -4046,7 +4046,6 @@ err_out_free_regions:
|
||||
pci_release_regions(pdev);
|
||||
err_out_disable_pdev:
|
||||
pci_disable_device(pdev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
err_out:
|
||||
return err;
|
||||
}
|
||||
@ -4090,7 +4089,6 @@ static void skge_remove(struct pci_dev *pdev)
|
||||
|
||||
iounmap(hw->regs);
|
||||
kfree(hw);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -5081,7 +5081,6 @@ err_out_free_regions:
|
||||
err_out_disable:
|
||||
pci_disable_device(pdev);
|
||||
err_out:
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -5124,8 +5123,6 @@ static void sky2_remove(struct pci_dev *pdev)
|
||||
|
||||
iounmap(hw->regs);
|
||||
kfree(hw);
|
||||
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static int sky2_suspend(struct device *dev)
|
||||
|
@ -7150,8 +7150,6 @@ static void pcidev_exit(struct pci_dev *pdev)
|
||||
struct platform_info *info = pci_get_drvdata(pdev);
|
||||
struct dev_info *hw_priv = &info->dev_info;
|
||||
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
|
||||
release_mem_region(pci_resource_start(pdev, 0),
|
||||
pci_resource_len(pdev, 0));
|
||||
for (i = 0; i < hw_priv->hw.dev_count; i++) {
|
||||
|
@ -4208,7 +4208,6 @@ static void myri10ge_remove(struct pci_dev *pdev)
|
||||
set_fw_name(mgp, NULL, false);
|
||||
free_netdev(netdev);
|
||||
pci_disable_device(pdev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
#define PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E 0x0008
|
||||
|
@ -970,7 +970,6 @@ static int natsemi_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
|
||||
err_ioremap:
|
||||
pci_release_regions(pdev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
|
||||
err_pci_request_regions:
|
||||
free_netdev(dev);
|
||||
@ -3220,7 +3219,6 @@ static void natsemi_remove1(struct pci_dev *pdev)
|
||||
pci_release_regions (pdev);
|
||||
iounmap(ioaddr);
|
||||
free_netdev (dev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
@ -8185,7 +8185,6 @@ mem_alloc_failed:
|
||||
free_shared_mem(sp);
|
||||
pci_disable_device(pdev);
|
||||
pci_release_regions(pdev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
free_netdev(dev);
|
||||
|
||||
return ret;
|
||||
@ -8221,7 +8220,6 @@ static void s2io_rem_nic(struct pci_dev *pdev)
|
||||
iounmap(sp->bar0);
|
||||
iounmap(sp->bar1);
|
||||
pci_release_regions(pdev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
free_netdev(dev);
|
||||
pci_disable_device(pdev);
|
||||
}
|
||||
|
@ -4739,7 +4739,6 @@ _exit6:
|
||||
_exit5:
|
||||
vxge_device_unregister(hldev);
|
||||
_exit4:
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
vxge_hw_device_terminate(hldev);
|
||||
pci_disable_sriov(pdev);
|
||||
_exit3:
|
||||
@ -4782,7 +4781,6 @@ static void vxge_remove(struct pci_dev *pdev)
|
||||
vxge_free_mac_add_list(&vdev->vpaths[i]);
|
||||
|
||||
vxge_device_unregister(hldev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
/* Do not call pci_disable_sriov here, as it will break child devices */
|
||||
vxge_hw_device_terminate(hldev);
|
||||
iounmap(vdev->bar0);
|
||||
|
@ -1910,7 +1910,6 @@ static void hamachi_remove_one(struct pci_dev *pdev)
|
||||
iounmap(hmp->base);
|
||||
free_netdev(dev);
|
||||
pci_release_regions(pdev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -513,7 +513,6 @@ err_out_unmap_rx:
|
||||
err_out_unmap_tx:
|
||||
pci_free_consistent(pdev, TX_TOTAL_SIZE, np->tx_ring, np->tx_ring_dma);
|
||||
err_out_cleardev:
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
pci_iounmap(pdev, ioaddr);
|
||||
err_out_free_res:
|
||||
pci_release_regions(pdev);
|
||||
@ -1392,7 +1391,6 @@ static void yellowfin_remove_one(struct pci_dev *pdev)
|
||||
pci_release_regions (pdev);
|
||||
|
||||
free_netdev (dev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user