.. | .. |
---|
255 | 255 | return ret; |
---|
256 | 256 | } |
---|
257 | 257 | |
---|
258 | | -static u32 pm8001_setup_irq(struct pm8001_hba_info *pm8001_ha); |
---|
259 | 258 | static u32 pm8001_request_irq(struct pm8001_hba_info *pm8001_ha); |
---|
260 | 259 | |
---|
261 | 260 | /** |
---|
.. | .. |
---|
275 | 274 | pm8001_dbg(pm8001_ha, INIT, "pm8001_alloc: PHY:%x\n", |
---|
276 | 275 | pm8001_ha->chip->n_phy); |
---|
277 | 276 | |
---|
278 | | - /* Setup Interrupt */ |
---|
279 | | - rc = pm8001_setup_irq(pm8001_ha); |
---|
280 | | - if (rc) { |
---|
281 | | - pm8001_dbg(pm8001_ha, FAIL, |
---|
282 | | - "pm8001_setup_irq failed [ret: %d]\n", rc); |
---|
283 | | - goto err_out; |
---|
284 | | - } |
---|
285 | 277 | /* Request Interrupt */ |
---|
286 | 278 | rc = pm8001_request_irq(pm8001_ha); |
---|
287 | 279 | if (rc) |
---|
.. | .. |
---|
990 | 982 | } |
---|
991 | 983 | #endif |
---|
992 | 984 | |
---|
993 | | -static u32 pm8001_setup_irq(struct pm8001_hba_info *pm8001_ha) |
---|
994 | | -{ |
---|
995 | | - struct pci_dev *pdev; |
---|
996 | | - |
---|
997 | | - pdev = pm8001_ha->pdev; |
---|
998 | | - |
---|
999 | | -#ifdef PM8001_USE_MSIX |
---|
1000 | | - if (pci_find_capability(pdev, PCI_CAP_ID_MSIX)) |
---|
1001 | | - return pm8001_setup_msix(pm8001_ha); |
---|
1002 | | - pm8001_dbg(pm8001_ha, INIT, "MSIX not supported!!!\n"); |
---|
1003 | | -#endif |
---|
1004 | | - return 0; |
---|
1005 | | -} |
---|
1006 | | - |
---|
1007 | 985 | /** |
---|
1008 | 986 | * pm8001_request_irq - register interrupt |
---|
1009 | 987 | * @pm8001_ha: our ha struct. |
---|
1010 | 988 | */ |
---|
1011 | 989 | static u32 pm8001_request_irq(struct pm8001_hba_info *pm8001_ha) |
---|
1012 | 990 | { |
---|
1013 | | - struct pci_dev *pdev; |
---|
| 991 | + struct pci_dev *pdev = pm8001_ha->pdev; |
---|
| 992 | +#ifdef PM8001_USE_MSIX |
---|
1014 | 993 | int rc; |
---|
1015 | 994 | |
---|
1016 | | - pdev = pm8001_ha->pdev; |
---|
| 995 | + if (pci_find_capability(pdev, PCI_CAP_ID_MSIX)) { |
---|
| 996 | + rc = pm8001_setup_msix(pm8001_ha); |
---|
| 997 | + if (rc) { |
---|
| 998 | + pm8001_dbg(pm8001_ha, FAIL, |
---|
| 999 | + "pm8001_setup_irq failed [ret: %d]\n", rc); |
---|
| 1000 | + return rc; |
---|
| 1001 | + } |
---|
1017 | 1002 | |
---|
1018 | | -#ifdef PM8001_USE_MSIX |
---|
1019 | | - if (pdev->msix_cap && pci_msi_enabled()) |
---|
1020 | | - return pm8001_request_msix(pm8001_ha); |
---|
1021 | | - else { |
---|
1022 | | - pm8001_dbg(pm8001_ha, INIT, "MSIX not supported!!!\n"); |
---|
1023 | | - goto intx; |
---|
| 1003 | + if (pdev->msix_cap && pci_msi_enabled()) |
---|
| 1004 | + return pm8001_request_msix(pm8001_ha); |
---|
1024 | 1005 | } |
---|
| 1006 | + |
---|
| 1007 | + pm8001_dbg(pm8001_ha, INIT, "MSIX not supported!!!\n"); |
---|
1025 | 1008 | #endif |
---|
1026 | 1009 | |
---|
1027 | | -intx: |
---|
1028 | 1010 | /* initialize the INT-X interrupt */ |
---|
1029 | 1011 | pm8001_ha->irq_vector[0].irq_id = 0; |
---|
1030 | 1012 | pm8001_ha->irq_vector[0].drv_inst = pm8001_ha; |
---|
1031 | | - rc = request_irq(pdev->irq, pm8001_interrupt_handler_intx, IRQF_SHARED, |
---|
1032 | | - pm8001_ha->name, SHOST_TO_SAS_HA(pm8001_ha->shost)); |
---|
1033 | | - return rc; |
---|
| 1013 | + |
---|
| 1014 | + return request_irq(pdev->irq, pm8001_interrupt_handler_intx, |
---|
| 1015 | + IRQF_SHARED, pm8001_ha->name, |
---|
| 1016 | + SHOST_TO_SAS_HA(pm8001_ha->shost)); |
---|
1034 | 1017 | } |
---|
1035 | 1018 | |
---|
1036 | 1019 | /** |
---|