Commit c0357e97 authored by Francois Romieu's avatar Francois Romieu

bnx2: stop using net_device.{base_addr, irq}.

Signed-off-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
Acked-by: default avatarMichael Chan <mchan@broadcom.com>
parent 2d5fb628
...@@ -7976,7 +7976,6 @@ static int __devinit ...@@ -7976,7 +7976,6 @@ static int __devinit
bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
{ {
struct bnx2 *bp; struct bnx2 *bp;
unsigned long mem_len;
int rc, i, j; int rc, i, j;
u32 reg; u32 reg;
u64 dma_mask, persist_dma_mask; u64 dma_mask, persist_dma_mask;
...@@ -8036,13 +8035,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) ...@@ -8036,13 +8035,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
#endif #endif
INIT_WORK(&bp->reset_task, bnx2_reset_task); INIT_WORK(&bp->reset_task, bnx2_reset_task);
dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0); bp->regview = pci_iomap(pdev, 0, MB_GET_CID_ADDR(TX_TSS_CID +
mem_len = MB_GET_CID_ADDR(TX_TSS_CID + TX_MAX_TSS_RINGS + 1); TX_MAX_TSS_RINGS + 1));
dev->mem_end = dev->mem_start + mem_len;
dev->irq = pdev->irq;
bp->regview = ioremap_nocache(dev->base_addr, mem_len);
if (!bp->regview) { if (!bp->regview) {
dev_err(&pdev->dev, "Cannot map register space, aborting\n"); dev_err(&pdev->dev, "Cannot map register space, aborting\n");
rc = -ENOMEM; rc = -ENOMEM;
...@@ -8346,10 +8340,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) ...@@ -8346,10 +8340,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
bp->flags &= ~BNX2_FLAG_AER_ENABLED; bp->flags &= ~BNX2_FLAG_AER_ENABLED;
} }
if (bp->regview) { pci_iounmap(pdev, bp->regview);
iounmap(bp->regview); bp->regview = NULL;
bp->regview = NULL;
}
err_out_release: err_out_release:
pci_release_regions(pdev); pci_release_regions(pdev);
...@@ -8432,7 +8424,7 @@ static int __devinit ...@@ -8432,7 +8424,7 @@ static int __devinit
bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int version_printed = 0; static int version_printed = 0;
struct net_device *dev = NULL; struct net_device *dev;
struct bnx2 *bp; struct bnx2 *bp;
int rc; int rc;
char str[40]; char str[40];
...@@ -8442,15 +8434,12 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -8442,15 +8434,12 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* dev zeroed in init_etherdev */ /* dev zeroed in init_etherdev */
dev = alloc_etherdev_mq(sizeof(*bp), TX_MAX_RINGS); dev = alloc_etherdev_mq(sizeof(*bp), TX_MAX_RINGS);
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
rc = bnx2_init_board(pdev, dev); rc = bnx2_init_board(pdev, dev);
if (rc < 0) { if (rc < 0)
free_netdev(dev); goto err_free;
return rc;
}
dev->netdev_ops = &bnx2_netdev_ops; dev->netdev_ops = &bnx2_netdev_ops;
dev->watchdog_timeo = TX_TIMEOUT; dev->watchdog_timeo = TX_TIMEOUT;
...@@ -8480,22 +8469,21 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -8480,22 +8469,21 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
goto error; goto error;
} }
netdev_info(dev, "%s (%c%d) %s found at mem %lx, IRQ %d, node addr %pM\n", netdev_info(dev, "%s (%c%d) %s found at mem %lx, IRQ %d, "
board_info[ent->driver_data].name, "node addr %pM\n", board_info[ent->driver_data].name,
((CHIP_ID(bp) & 0xf000) >> 12) + 'A', ((CHIP_ID(bp) & 0xf000) >> 12) + 'A',
((CHIP_ID(bp) & 0x0ff0) >> 4), ((CHIP_ID(bp) & 0x0ff0) >> 4),
bnx2_bus_string(bp, str), bnx2_bus_string(bp, str), (long)pci_resource_start(pdev, 0),
dev->base_addr, pdev->irq, dev->dev_addr);
bp->pdev->irq, dev->dev_addr);
return 0; return 0;
error: error:
if (bp->regview) iounmap(bp->regview);
iounmap(bp->regview);
pci_release_regions(pdev); pci_release_regions(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
err_free:
free_netdev(dev); free_netdev(dev);
return rc; return rc;
} }
...@@ -8511,8 +8499,7 @@ bnx2_remove_one(struct pci_dev *pdev) ...@@ -8511,8 +8499,7 @@ bnx2_remove_one(struct pci_dev *pdev)
del_timer_sync(&bp->timer); del_timer_sync(&bp->timer);
cancel_work_sync(&bp->reset_task); cancel_work_sync(&bp->reset_task);
if (bp->regview) pci_iounmap(bp->pdev, bp->regview);
iounmap(bp->regview);
kfree(bp->temp_stats_blk); kfree(bp->temp_stats_blk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment