diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-02-17 23:26:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-17 23:26:22 -0500 |
commit | ef38fa77786584c630f5da6696111a6a558c7f23 (patch) | |
tree | 861d7ff40a3f9678365e48b73abb70f901be1a44 /drivers/net/netxen | |
parent | ad7bf428328d360b54e0d5f5fc7a9c0a6cf3b7fe (diff) |
netxen: remove superfluous doorbell map
For NX3031 pci doorbells are not used. If unnecessary mapping
of doorbell space fails, pci probe bails out.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 4fe20ecdbc6b..74017790f4a9 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -482,7 +482,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
482 | 482 | ||
483 | 483 | ||
484 | u8 __iomem *db_ptr = NULL; | 484 | u8 __iomem *db_ptr = NULL; |
485 | unsigned long mem_base, mem_len, db_base, db_len, pci_len0 = 0; | 485 | unsigned long mem_base, mem_len, db_base, db_len = 0, pci_len0 = 0; |
486 | int i = 0, err; | 486 | int i = 0, err; |
487 | int first_driver, first_boot; | 487 | int first_driver, first_boot; |
488 | u32 val; | 488 | u32 val; |
@@ -611,6 +611,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
611 | 611 | ||
612 | dev_info(&pdev->dev, "%dMB memory map\n", (int)(mem_len>>20)); | 612 | dev_info(&pdev->dev, "%dMB memory map\n", (int)(mem_len>>20)); |
613 | 613 | ||
614 | if (NX_IS_REVISION_P3(revision_id)) | ||
615 | goto skip_doorbell; | ||
616 | |||
614 | db_base = pci_resource_start(pdev, 4); /* doorbell is on bar 4 */ | 617 | db_base = pci_resource_start(pdev, 4); /* doorbell is on bar 4 */ |
615 | db_len = pci_resource_len(pdev, 4); | 618 | db_len = pci_resource_len(pdev, 4); |
616 | 619 | ||
@@ -620,8 +623,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
620 | err = -EIO; | 623 | err = -EIO; |
621 | goto err_out_iounmap; | 624 | goto err_out_iounmap; |
622 | } | 625 | } |
623 | DPRINTK(INFO, "doorbell ioremap from %lx a size of %lx\n", db_base, | ||
624 | db_len); | ||
625 | 626 | ||
626 | db_ptr = ioremap(db_base, NETXEN_DB_MAPSIZE_BYTES); | 627 | db_ptr = ioremap(db_base, NETXEN_DB_MAPSIZE_BYTES); |
627 | if (!db_ptr) { | 628 | if (!db_ptr) { |
@@ -630,8 +631,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
630 | err = -EIO; | 631 | err = -EIO; |
631 | goto err_out_iounmap; | 632 | goto err_out_iounmap; |
632 | } | 633 | } |
633 | DPRINTK(INFO, "doorbell ioremaped at %p\n", db_ptr); | ||
634 | 634 | ||
635 | skip_doorbell: | ||
635 | adapter->ahw.pci_base0 = mem_ptr0; | 636 | adapter->ahw.pci_base0 = mem_ptr0; |
636 | adapter->ahw.pci_len0 = pci_len0; | 637 | adapter->ahw.pci_len0 = pci_len0; |
637 | adapter->ahw.first_page_group_start = first_page_group_start; | 638 | adapter->ahw.first_page_group_start = first_page_group_start; |
@@ -941,8 +942,9 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
941 | if (adapter->flags & NETXEN_NIC_MSI_ENABLED) | 942 | if (adapter->flags & NETXEN_NIC_MSI_ENABLED) |
942 | pci_disable_msi(pdev); | 943 | pci_disable_msi(pdev); |
943 | 944 | ||
944 | iounmap(adapter->ahw.db_base); | ||
945 | iounmap(adapter->ahw.pci_base0); | 945 | iounmap(adapter->ahw.pci_base0); |
946 | if (adapter->ahw.db_base != NULL) | ||
947 | iounmap(adapter->ahw.db_base); | ||
946 | if (adapter->ahw.pci_base1 != NULL) | 948 | if (adapter->ahw.pci_base1 != NULL) |
947 | iounmap(adapter->ahw.pci_base1); | 949 | iounmap(adapter->ahw.pci_base1); |
948 | if (adapter->ahw.pci_base2 != NULL) | 950 | if (adapter->ahw.pci_base2 != NULL) |