diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-02-24 06:44:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-24 06:44:23 -0500 |
commit | 028e1415a78733fcd2cba4b4c001826cc37a373e (patch) | |
tree | ed708093d3572bde15432c53d1c6a3d1102740af /drivers/net | |
parent | 044fad0dbb4e814c061916fe5a36851af2fd1135 (diff) |
netxen: handle pci bar 0 mapping failure
PCI bar 0 is used for memory mapped register access.
If ioremap fails (returns NULL), register access results
in crash.
Use pci_ioremap_bar() instead of ioremap(), the latter
fails on on 32 bit powerpc where pci resource address is
> 32 bits.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index f42581157f4e..13087782ac40 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -588,7 +588,12 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
588 | adapter->pci_mem_read = netxen_nic_pci_mem_read_2M; | 588 | adapter->pci_mem_read = netxen_nic_pci_mem_read_2M; |
589 | adapter->pci_mem_write = netxen_nic_pci_mem_write_2M; | 589 | adapter->pci_mem_write = netxen_nic_pci_mem_write_2M; |
590 | 590 | ||
591 | mem_ptr0 = ioremap(mem_base, mem_len); | 591 | mem_ptr0 = pci_ioremap_bar(pdev, 0); |
592 | if (mem_ptr0 == NULL) { | ||
593 | dev_err(&pdev->dev, "failed to map PCI bar 0\n"); | ||
594 | return -EIO; | ||
595 | } | ||
596 | |||
592 | pci_len0 = mem_len; | 597 | pci_len0 = mem_len; |
593 | first_page_group_start = 0; | 598 | first_page_group_start = 0; |
594 | first_page_group_end = 0; | 599 | first_page_group_end = 0; |