aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJing Huang <huangj@brocade.com>2010-03-19 14:06:44 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-04-11 10:24:19 -0400
commitb3522f08ec7011aed0abc477bfedd00d189e9cd6 (patch)
tree369e355b051628a316724686fa07c822676163af /drivers
parent2eba0d4c000777ce43012d7fda806b075f6cf877 (diff)
[SCSI] bfa: use pci_iomap() and pci_iounmap()
Use pci_iomap() and pci_iounmap() to simplify the code. Remove uncessary #ifdef check for ia64 (it was added as a workaound for some RHEL 5.x release which doesn't export iounmap function) Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/bfa/bfad.c9
-rw-r--r--drivers/scsi/bfa/bfad_drv.h1
2 files changed, 1 insertions, 9 deletions
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 3a5163d3675d..0baeabadb5b2 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -590,7 +590,6 @@ bfad_init_timer(struct bfad_s *bfad)
590int 590int
591bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad) 591bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad)
592{ 592{
593 unsigned long bar0_len;
594 int rc = -ENODEV; 593 int rc = -ENODEV;
595 594
596 if (pci_enable_device(pdev)) { 595 if (pci_enable_device(pdev)) {
@@ -610,9 +609,7 @@ bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad)
610 goto out_release_region; 609 goto out_release_region;
611 } 610 }
612 611
613 bfad->pci_bar0_map = pci_resource_start(pdev, 0); 612 bfad->pci_bar0_kva = pci_iomap(pdev, 0, pci_resource_len(pdev, 0));
614 bar0_len = pci_resource_len(pdev, 0);
615 bfad->pci_bar0_kva = ioremap(bfad->pci_bar0_map, bar0_len);
616 613
617 if (bfad->pci_bar0_kva == NULL) { 614 if (bfad->pci_bar0_kva == NULL) {
618 BFA_PRINTF(BFA_ERR, "Fail to map bar0\n"); 615 BFA_PRINTF(BFA_ERR, "Fail to map bar0\n");
@@ -645,11 +642,7 @@ out:
645void 642void
646bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad) 643bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad)
647{ 644{
648#if defined(__ia64__)
649 pci_iounmap(pdev, bfad->pci_bar0_kva); 645 pci_iounmap(pdev, bfad->pci_bar0_kva);
650#else
651 iounmap(bfad->pci_bar0_kva);
652#endif
653 pci_release_regions(pdev); 646 pci_release_regions(pdev);
654 pci_disable_device(pdev); 647 pci_disable_device(pdev);
655 pci_set_drvdata(pdev, NULL); 648 pci_set_drvdata(pdev, NULL);
diff --git a/drivers/scsi/bfa/bfad_drv.h b/drivers/scsi/bfa/bfad_drv.h
index f4b14396c4ac..0639aedcb610 100644
--- a/drivers/scsi/bfa/bfad_drv.h
+++ b/drivers/scsi/bfa/bfad_drv.h
@@ -162,7 +162,6 @@ struct bfad_s {
162 const char *pci_name; 162 const char *pci_name;
163 struct bfa_pcidev_s hal_pcidev; 163 struct bfa_pcidev_s hal_pcidev;
164 struct bfa_ioc_pci_attr_s pci_attr; 164 struct bfa_ioc_pci_attr_s pci_attr;
165 unsigned long pci_bar0_map;
166 void __iomem *pci_bar0_kva; 165 void __iomem *pci_bar0_kva;
167 struct completion comp; 166 struct completion comp;
168 struct completion suspend; 167 struct completion suspend;