|
@@ -3747,24 +3747,6 @@ static void hermon_free ( struct hermon *hermon ) {
|
3747
|
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
|
3751
|
* Probe PCI device
|
3770
|
3752
|
*
|
|
@@ -3789,8 +3771,14 @@ static int hermon_probe ( struct pci_device *pci ) {
|
3789
|
3771
|
pci_set_drvdata ( pci, hermon );
|
3790
|
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
|
3783
|
/* Reset device */
|
3796
|
3784
|
hermon_reset ( hermon );
|
|
@@ -3885,6 +3873,8 @@ static int hermon_probe ( struct pci_device *pci ) {
|
3885
|
3873
|
err_get_cap:
|
3886
|
3874
|
hermon_stop_firmware ( hermon );
|
3887
|
3875
|
err_start_firmware:
|
|
3876
|
+ iounmap ( hermon->uar );
|
|
3877
|
+ iounmap ( hermon->config );
|
3888
|
3878
|
hermon_free ( hermon );
|
3889
|
3879
|
err_alloc:
|
3890
|
3880
|
return rc;
|
|
@@ -3910,6 +3900,8 @@ static void hermon_remove ( struct pci_device *pci ) {
|
3910
|
3900
|
}
|
3911
|
3901
|
for ( i = ( hermon->cap.num_ports - 1 ) ; i >= 0 ; i-- )
|
3912
|
3902
|
ibdev_put ( hermon->port[i].ibdev );
|
|
3903
|
+ iounmap ( hermon->uar );
|
|
3904
|
+ iounmap ( hermon->config );
|
3913
|
3905
|
hermon_free ( hermon );
|
3914
|
3906
|
}
|
3915
|
3907
|
|
|
@@ -3933,8 +3925,12 @@ static int hermon_bofm_probe ( struct pci_device *pci ) {
|
3933
|
3925
|
pci_set_drvdata ( pci, hermon );
|
3934
|
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
|
3935
|
/* Initialise BOFM device */
|
3940
|
3936
|
bofm_init ( &hermon->bofm, pci, &hermon_bofm_operations );
|
|
@@ -3949,6 +3945,7 @@ static int hermon_bofm_probe ( struct pci_device *pci ) {
|
3949
|
3945
|
return 0;
|
3950
|
3946
|
|
3951
|
3947
|
err_bofm_register:
|
|
3948
|
+ iounmap ( hermon->config );
|
3952
|
3949
|
hermon_free ( hermon );
|
3953
|
3950
|
err_alloc:
|
3954
|
3951
|
return rc;
|
|
@@ -3963,6 +3960,7 @@ static void hermon_bofm_remove ( struct pci_device *pci ) {
|
3963
|
3960
|
struct hermon *hermon = pci_get_drvdata ( pci );
|
3964
|
3961
|
|
3965
|
3962
|
bofm_unregister ( &hermon->bofm );
|
|
3963
|
+ iounmap ( hermon->config );
|
3966
|
3964
|
hermon_free ( hermon );
|
3967
|
3965
|
}
|
3968
|
3966
|
|