Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 275f165f authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Jeff Garzik
Browse files

pci: use pci_ioremap_bar() in drivers/net



Use the newly introduced pci_ioremap_bar() function in drivers/net.
pci_ioremap_bar() just takes a pci device and a bar number, with the goal
of making it really hard to get wrong, while also having a central place
to stick sanity checks.

Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 842e08bd
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -10087,8 +10087,7 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,

	dev->irq = pdev->irq;

	bp->regview = ioremap_nocache(dev->base_addr,
				      pci_resource_len(pdev, 0));
	bp->regview = pci_ioremap_bar(pdev, 0);
	if (!bp->regview) {
		printk(KERN_ERR PFX "Cannot map register space, aborting\n");
		rc = -ENOMEM;
+2 −5
Original line number Diff line number Diff line
@@ -966,8 +966,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
	hw->back = adapter;

	err = -EIO;
	hw->hw_addr = ioremap(pci_resource_start(pdev, BAR_0),
			      pci_resource_len(pdev, BAR_0));
	hw->hw_addr = pci_ioremap_bar(pdev, BAR_0);
	if (!hw->hw_addr)
		goto err_ioremap;

@@ -1015,9 +1014,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
	 * because it depends on mac_type */
	if ((hw->mac_type == e1000_ich8lan) &&
	   (pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
		hw->flash_address =
			ioremap(pci_resource_start(pdev, 1),
				pci_resource_len(pdev, 1));
		hw->flash_address = pci_ioremap_bar(pdev, 1);
		if (!hw->flash_address)
			goto err_flashmap;
	}
+1 −1
Original line number Diff line number Diff line
@@ -363,7 +363,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
	ioaddr = pci_resource_start (pdev, 0);
#else
	ioaddr = pci_resource_start (pdev, 1);
	ioaddr = (long) ioremap (ioaddr, pci_resource_len (pdev, 1));
	ioaddr = (long) pci_ioremap_bar(pdev, 1);
	if (!ioaddr) {
		dev_err(&pdev->dev, "ioremap failed\n");
		goto err_out_free_netdev;
+1 −2
Original line number Diff line number Diff line
@@ -381,8 +381,7 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	adapter->hw.back = adapter;
	adapter->msg_enable = netif_msg_init(debug, DEFAULT_DEBUG_LEVEL_SHIFT);

	adapter->hw.hw_addr = ioremap(pci_resource_start(pdev, BAR_0),
	                              pci_resource_len(pdev, BAR_0));
	adapter->hw.hw_addr = pci_ioremap_bar(pdev, BAR_0);
	if (!adapter->hw.hw_addr) {
		err = -EIO;
		goto err_ioremap;
+1 −3
Original line number Diff line number Diff line
@@ -3977,9 +3977,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,
	if (qdev->device_id == QL3032_DEVICE_ID)
		ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;

	qdev->mem_map_registers =
	    ioremap_nocache(pci_resource_start(pdev, 1),
			    pci_resource_len(qdev->pdev, 1));
	qdev->mem_map_registers = pci_ioremap_bar(pdev, 1);
	if (!qdev->mem_map_registers) {
		printk(KERN_ERR PFX "%s: cannot map device registers\n",
		       pci_name(pdev));
Loading