aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/efx.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-10-23 04:32:33 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-24 07:27:18 -0400
commitdc803df8dd68a045bea4753f5300eeecb961ca2d (patch)
tree3b9400298648a7a23d1674facff07830c761a3fd /drivers/net/sfc/efx.c
parent8698a6b642910a3d35be7160cd00dc98ab584d97 (diff)
sfc: Remove pointless abstraction of memory BAR number
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/efx.c')
-rw-r--r--drivers/net/sfc/efx.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 30951fb3d20f..29003fe9cb4c 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -818,9 +818,8 @@ static int efx_init_io(struct efx_nic *efx)
818 goto fail2; 818 goto fail2;
819 } 819 }
820 820
821 efx->membase_phys = pci_resource_start(efx->pci_dev, 821 efx->membase_phys = pci_resource_start(efx->pci_dev, EFX_MEM_BAR);
822 efx->type->mem_bar); 822 rc = pci_request_region(pci_dev, EFX_MEM_BAR, "sfc");
823 rc = pci_request_region(pci_dev, efx->type->mem_bar, "sfc");
824 if (rc) { 823 if (rc) {
825 EFX_ERR(efx, "request for memory BAR failed\n"); 824 EFX_ERR(efx, "request for memory BAR failed\n");
826 rc = -EIO; 825 rc = -EIO;
@@ -829,21 +828,20 @@ static int efx_init_io(struct efx_nic *efx)
829 efx->membase = ioremap_nocache(efx->membase_phys, 828 efx->membase = ioremap_nocache(efx->membase_phys,
830 efx->type->mem_map_size); 829 efx->type->mem_map_size);
831 if (!efx->membase) { 830 if (!efx->membase) {
832 EFX_ERR(efx, "could not map memory BAR %d at %llx+%x\n", 831 EFX_ERR(efx, "could not map memory BAR at %llx+%x\n",
833 efx->type->mem_bar,
834 (unsigned long long)efx->membase_phys, 832 (unsigned long long)efx->membase_phys,
835 efx->type->mem_map_size); 833 efx->type->mem_map_size);
836 rc = -ENOMEM; 834 rc = -ENOMEM;
837 goto fail4; 835 goto fail4;
838 } 836 }
839 EFX_LOG(efx, "memory BAR %u at %llx+%x (virtual %p)\n", 837 EFX_LOG(efx, "memory BAR at %llx+%x (virtual %p)\n",
840 efx->type->mem_bar, (unsigned long long)efx->membase_phys, 838 (unsigned long long)efx->membase_phys,
841 efx->type->mem_map_size, efx->membase); 839 efx->type->mem_map_size, efx->membase);
842 840
843 return 0; 841 return 0;
844 842
845 fail4: 843 fail4:
846 pci_release_region(efx->pci_dev, efx->type->mem_bar); 844 pci_release_region(efx->pci_dev, EFX_MEM_BAR);
847 fail3: 845 fail3:
848 efx->membase_phys = 0; 846 efx->membase_phys = 0;
849 fail2: 847 fail2:
@@ -862,7 +860,7 @@ static void efx_fini_io(struct efx_nic *efx)
862 } 860 }
863 861
864 if (efx->membase_phys) { 862 if (efx->membase_phys) {
865 pci_release_region(efx->pci_dev, efx->type->mem_bar); 863 pci_release_region(efx->pci_dev, EFX_MEM_BAR);
866 efx->membase_phys = 0; 864 efx->membase_phys = 0;
867 } 865 }
868 866