File tree Expand file tree Collapse file tree 1 file changed +5
-20
lines changed Expand file tree Collapse file tree 1 file changed +5
-20
lines changed Original file line number Diff line number Diff line change @@ -1080,28 +1080,13 @@ EXPORT_SYMBOL(pci_free_irq_vectors);
1080
1080
*/
1081
1081
int pci_irq_vector (struct pci_dev * dev , unsigned int nr )
1082
1082
{
1083
- if (dev -> msix_enabled ) {
1084
- struct msi_desc * entry ;
1085
-
1086
- for_each_pci_msi_entry (entry , dev ) {
1087
- if (entry -> msi_index == nr )
1088
- return entry -> irq ;
1089
- }
1090
- WARN_ON_ONCE (1 );
1091
- return - EINVAL ;
1092
- }
1083
+ unsigned int irq ;
1093
1084
1094
- if (dev -> msi_enabled ) {
1095
- struct msi_desc * entry = first_pci_msi_entry (dev );
1096
-
1097
- if (WARN_ON_ONCE (nr >= entry -> nvec_used ))
1098
- return - EINVAL ;
1099
- } else {
1100
- if (WARN_ON_ONCE (nr > 0 ))
1101
- return - EINVAL ;
1102
- }
1085
+ if (!dev -> msi_enabled && !dev -> msix_enabled )
1086
+ return !nr ? dev -> irq : - EINVAL ;
1103
1087
1104
- return dev -> irq + nr ;
1088
+ irq = msi_get_virq (& dev -> dev , nr );
1089
+ return irq ? irq : - EINVAL ;
1105
1090
}
1106
1091
EXPORT_SYMBOL (pci_irq_vector );
1107
1092
You can’t perform that action at this time.
0 commit comments