diff options
Diffstat (limited to 'arch/powerpc/kernel/prom_parse.c')
-rw-r--r-- | arch/powerpc/kernel/prom_parse.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c index 603dff3ad62a..17fcb4842fe5 100644 --- a/arch/powerpc/kernel/prom_parse.c +++ b/arch/powerpc/kernel/prom_parse.c | |||
@@ -914,6 +914,17 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq) | |||
914 | u8 pin; | 914 | u8 pin; |
915 | int rc; | 915 | int rc; |
916 | 916 | ||
917 | /* We need to first check if the PCI device has a PCI interrupt at all | ||
918 | * since we have cases where the device-node might expose non-PCI | ||
919 | * interrupts, but the device has no PCI interrupt to it | ||
920 | */ | ||
921 | rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); | ||
922 | if (rc != 0) | ||
923 | return rc; | ||
924 | /* No pin, exit */ | ||
925 | if (pin == 0) | ||
926 | return -ENODEV; | ||
927 | |||
917 | /* Check if we have a device node, if yes, fallback to standard OF | 928 | /* Check if we have a device node, if yes, fallback to standard OF |
918 | * parsing | 929 | * parsing |
919 | */ | 930 | */ |
@@ -925,12 +936,6 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq) | |||
925 | * interrupt spec. we assume #interrupt-cells is 1, which is standard | 936 | * interrupt spec. we assume #interrupt-cells is 1, which is standard |
926 | * for PCI. If you do different, then don't use that routine. | 937 | * for PCI. If you do different, then don't use that routine. |
927 | */ | 938 | */ |
928 | rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); | ||
929 | if (rc != 0) | ||
930 | return rc; | ||
931 | /* No pin, exit */ | ||
932 | if (pin == 0) | ||
933 | return -ENODEV; | ||
934 | 939 | ||
935 | /* Now we walk up the PCI tree */ | 940 | /* Now we walk up the PCI tree */ |
936 | lspec = pin; | 941 | lspec = pin; |