Browse Source

[arbel] Add missing iounmap()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 years ago
parent
commit
692324905e
1 changed files with 14 additions and 10 deletions
  1. 14
    10
      src/drivers/infiniband/arbel.c

+ 14
- 10
src/drivers/infiniband/arbel.c View File

3000
 	pci_set_drvdata ( pci, arbel );
3000
 	pci_set_drvdata ( pci, arbel );
3001
 	arbel->pci = pci;
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
 	/* Allocate Infiniband devices */
3013
 	/* Allocate Infiniband devices */
3004
 	for ( i = 0 ; i < ARBEL_NUM_PORTS ; i++ ) {
3014
 	for ( i = 0 ; i < ARBEL_NUM_PORTS ; i++ ) {
3005
 		ibdev = alloc_ibdev ( 0 );
3015
 		ibdev = alloc_ibdev ( 0 );
3014
 		ib_set_drvdata ( ibdev, arbel );
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
 	/* Reset device */
3027
 	/* Reset device */
3028
 	arbel_reset ( arbel );
3028
 	arbel_reset ( arbel );
3029
 
3029
 
3072
  err_alloc_ibdev:
3072
  err_alloc_ibdev:
3073
 	for ( i-- ; i >= 0 ; i-- )
3073
 	for ( i-- ; i >= 0 ; i-- )
3074
 		ibdev_put ( arbel->ibdev[i] );
3074
 		ibdev_put ( arbel->ibdev[i] );
3075
+	iounmap ( arbel->uar );
3076
+	iounmap ( arbel->config );
3075
 	arbel_free ( arbel );
3077
 	arbel_free ( arbel );
3076
  err_alloc:
3078
  err_alloc:
3077
 	return rc;
3079
 	return rc;
3090
 		unregister_ibdev ( arbel->ibdev[i] );
3092
 		unregister_ibdev ( arbel->ibdev[i] );
3091
 	for ( i = ( ARBEL_NUM_PORTS - 1 ) ; i >= 0 ; i-- )
3093
 	for ( i = ( ARBEL_NUM_PORTS - 1 ) ; i >= 0 ; i-- )
3092
 		ibdev_put ( arbel->ibdev[i] );
3094
 		ibdev_put ( arbel->ibdev[i] );
3095
+	iounmap ( arbel->uar );
3096
+	iounmap ( arbel->config );
3093
 	arbel_free ( arbel );
3097
 	arbel_free ( arbel );
3094
 }
3098
 }
3095
 
3099
 

Loading…
Cancel
Save