Browse Source

[hermon] Add missing iounmap()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
e2cdbd51a8
1 changed files with 20 additions and 22 deletions
  1. 20
    22
      src/drivers/infiniband/hermon.c

+ 20
- 22
src/drivers/infiniband/hermon.c View File

3747
 	free ( hermon );
3747
 	free ( hermon );
3748
 }
3748
 }
3749
 
3749
 
3750
-/**
3751
- * Initialise Hermon PCI parameters
3752
- *
3753
- * @v hermon		Hermon device
3754
- */
3755
-static void hermon_pci_init ( struct hermon *hermon ) {
3756
-	struct pci_device *pci = hermon->pci;
3757
-
3758
-	/* Fix up PCI device */
3759
-	adjust_pci_device ( pci );
3760
-
3761
-	/* Get PCI BARs */
3762
-	hermon->config = ioremap ( pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR),
3763
-				   HERMON_PCI_CONFIG_BAR_SIZE );
3764
-	hermon->uar = ioremap ( pci_bar_start ( pci, HERMON_PCI_UAR_BAR ),
3765
-				HERMON_UAR_NON_EQ_PAGE * HERMON_PAGE_SIZE );
3766
-}
3767
-
3768
 /**
3750
 /**
3769
  * Probe PCI device
3751
  * Probe PCI device
3770
  *
3752
  *
3789
 	pci_set_drvdata ( pci, hermon );
3771
 	pci_set_drvdata ( pci, hermon );
3790
 	hermon->pci = pci;
3772
 	hermon->pci = pci;
3791
 
3773
 
3792
-	/* Initialise PCI parameters */
3793
-	hermon_pci_init ( hermon );
3774
+	/* Fix up PCI device */
3775
+	adjust_pci_device ( pci );
3776
+
3777
+	/* Map PCI BARs */
3778
+	hermon->config = ioremap ( pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR ),
3779
+				   HERMON_PCI_CONFIG_BAR_SIZE );
3780
+	hermon->uar = ioremap ( pci_bar_start ( pci, HERMON_PCI_UAR_BAR ),
3781
+				HERMON_UAR_NON_EQ_PAGE * HERMON_PAGE_SIZE );
3794
 
3782
 
3795
 	/* Reset device */
3783
 	/* Reset device */
3796
 	hermon_reset ( hermon );
3784
 	hermon_reset ( hermon );
3885
  err_get_cap:
3873
  err_get_cap:
3886
 	hermon_stop_firmware ( hermon );
3874
 	hermon_stop_firmware ( hermon );
3887
  err_start_firmware:
3875
  err_start_firmware:
3876
+	iounmap ( hermon->uar );
3877
+	iounmap ( hermon->config );
3888
 	hermon_free ( hermon );
3878
 	hermon_free ( hermon );
3889
  err_alloc:
3879
  err_alloc:
3890
 	return rc;
3880
 	return rc;
3910
 	}
3900
 	}
3911
 	for ( i = ( hermon->cap.num_ports - 1 ) ; i >= 0 ; i-- )
3901
 	for ( i = ( hermon->cap.num_ports - 1 ) ; i >= 0 ; i-- )
3912
 		ibdev_put ( hermon->port[i].ibdev );
3902
 		ibdev_put ( hermon->port[i].ibdev );
3903
+	iounmap ( hermon->uar );
3904
+	iounmap ( hermon->config );
3913
 	hermon_free ( hermon );
3905
 	hermon_free ( hermon );
3914
 }
3906
 }
3915
 
3907
 
3933
 	pci_set_drvdata ( pci, hermon );
3925
 	pci_set_drvdata ( pci, hermon );
3934
 	hermon->pci = pci;
3926
 	hermon->pci = pci;
3935
 
3927
 
3936
-	/* Initialise PCI parameters */
3937
-	hermon_pci_init ( hermon );
3928
+	/* Fix up PCI device */
3929
+	adjust_pci_device ( pci );
3930
+
3931
+	/* Map PCI BAR */
3932
+	hermon->config = ioremap ( pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR ),
3933
+				   HERMON_PCI_CONFIG_BAR_SIZE );
3938
 
3934
 
3939
 	/* Initialise BOFM device */
3935
 	/* Initialise BOFM device */
3940
 	bofm_init ( &hermon->bofm, pci, &hermon_bofm_operations );
3936
 	bofm_init ( &hermon->bofm, pci, &hermon_bofm_operations );
3949
 	return 0;
3945
 	return 0;
3950
 
3946
 
3951
  err_bofm_register:
3947
  err_bofm_register:
3948
+	iounmap ( hermon->config );
3952
 	hermon_free ( hermon );
3949
 	hermon_free ( hermon );
3953
  err_alloc:
3950
  err_alloc:
3954
 	return rc;
3951
 	return rc;
3963
 	struct hermon *hermon = pci_get_drvdata ( pci );
3960
 	struct hermon *hermon = pci_get_drvdata ( pci );
3964
 
3961
 
3965
 	bofm_unregister ( &hermon->bofm );
3962
 	bofm_unregister ( &hermon->bofm );
3963
+	iounmap ( hermon->config );
3966
 	hermon_free ( hermon );
3964
 	hermon_free ( hermon );
3967
 }
3965
 }
3968
 
3966
 

Loading…
Cancel
Save