Explorar el Código

[arbel] Add missing iounmap()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown hace 8 años
padre
commit
692324905e
Se han modificado 1 ficheros con 14 adiciones y 10 borrados
  1. 14
    10
      src/drivers/infiniband/arbel.c

+ 14
- 10
src/drivers/infiniband/arbel.c Ver fichero

@@ -3000,6 +3000,16 @@ static int arbel_probe ( struct pci_device *pci ) {
3000 3000
 	pci_set_drvdata ( pci, arbel );
3001 3001
 	arbel->pci = pci;
3002 3002
 
3003
+	/* Fix up PCI device */
3004
+	adjust_pci_device ( pci );
3005
+
3006
+	/* Map PCI BARs */
3007
+	arbel->config = ioremap ( pci_bar_start ( pci, ARBEL_PCI_CONFIG_BAR ),
3008
+				  ARBEL_PCI_CONFIG_BAR_SIZE );
3009
+	arbel->uar = ioremap ( ( pci_bar_start ( pci, ARBEL_PCI_UAR_BAR ) +
3010
+				 ARBEL_PCI_UAR_IDX * ARBEL_PCI_UAR_SIZE ),
3011
+			       ARBEL_PCI_UAR_SIZE );
3012
+
3003 3013
 	/* Allocate Infiniband devices */
3004 3014
 	for ( i = 0 ; i < ARBEL_NUM_PORTS ; i++ ) {
3005 3015
 		ibdev = alloc_ibdev ( 0 );
@@ -3014,16 +3024,6 @@ static int arbel_probe ( struct pci_device *pci ) {
3014 3024
 		ib_set_drvdata ( ibdev, arbel );
3015 3025
 	}
3016 3026
 
3017
-	/* Fix up PCI device */
3018
-	adjust_pci_device ( pci );
3019
-
3020
-	/* Get PCI BARs */
3021
-	arbel->config = ioremap ( pci_bar_start ( pci, ARBEL_PCI_CONFIG_BAR ),
3022
-				  ARBEL_PCI_CONFIG_BAR_SIZE );
3023
-	arbel->uar = ioremap ( ( pci_bar_start ( pci, ARBEL_PCI_UAR_BAR ) +
3024
-				 ARBEL_PCI_UAR_IDX * ARBEL_PCI_UAR_SIZE ),
3025
-			       ARBEL_PCI_UAR_SIZE );
3026
-
3027 3027
 	/* Reset device */
3028 3028
 	arbel_reset ( arbel );
3029 3029
 
@@ -3072,6 +3072,8 @@ static int arbel_probe ( struct pci_device *pci ) {
3072 3072
  err_alloc_ibdev:
3073 3073
 	for ( i-- ; i >= 0 ; i-- )
3074 3074
 		ibdev_put ( arbel->ibdev[i] );
3075
+	iounmap ( arbel->uar );
3076
+	iounmap ( arbel->config );
3075 3077
 	arbel_free ( arbel );
3076 3078
  err_alloc:
3077 3079
 	return rc;
@@ -3090,6 +3092,8 @@ static void arbel_remove ( struct pci_device *pci ) {
3090 3092
 		unregister_ibdev ( arbel->ibdev[i] );
3091 3093
 	for ( i = ( ARBEL_NUM_PORTS - 1 ) ; i >= 0 ; i-- )
3092 3094
 		ibdev_put ( arbel->ibdev[i] );
3095
+	iounmap ( arbel->uar );
3096
+	iounmap ( arbel->config );
3093 3097
 	arbel_free ( arbel );
3094 3098
 }
3095 3099
 

Loading…
Cancelar
Guardar