Commit c8aa33a7 authored by David Daney's avatar David Daney Committed by Rob Herring

of_pci_irq: Silence bogus "of_irq_parse_pci() failed ..." messages.

It is perfectly legitimate for a PCI device to have an
PCI_INTERRUPT_PIN value of zero.  This happens if the device doesn't
use interrupts, or on PCIe devices, where only MSI/MSI-X are
supported.

Silence the annoying "of_irq_parse_pci() failed with rc=-19" error
messages by moving the printing code into of_irq_parse_pci(), and only
emitting the message for cases where PCI_INTERRUPT_PIN == 0 is not the
cause for an early exit.
Signed-off-by: default avatarDavid Daney <david.daney@cavium.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 31b47ae3
...@@ -38,8 +38,8 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq ...@@ -38,8 +38,8 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq
*/ */
rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin);
if (rc != 0) if (rc != 0)
return rc; goto err;
/* No pin, exit */ /* No pin, exit with no error message. */
if (pin == 0) if (pin == 0)
return -ENODEV; return -ENODEV;
...@@ -53,8 +53,10 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq ...@@ -53,8 +53,10 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq
ppnode = pci_bus_to_OF_node(pdev->bus); ppnode = pci_bus_to_OF_node(pdev->bus);
/* No node for host bridge ? give up */ /* No node for host bridge ? give up */
if (ppnode == NULL) if (ppnode == NULL) {
return -EINVAL; rc = -EINVAL;
goto err;
}
} else { } else {
/* We found a P2P bridge, check if it has a node */ /* We found a P2P bridge, check if it has a node */
ppnode = pci_device_to_OF_node(ppdev); ppnode = pci_device_to_OF_node(ppdev);
...@@ -86,7 +88,13 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq ...@@ -86,7 +88,13 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq
out_irq->args[0] = pin; out_irq->args[0] = pin;
laddr[0] = cpu_to_be32((pdev->bus->number << 16) | (pdev->devfn << 8)); laddr[0] = cpu_to_be32((pdev->bus->number << 16) | (pdev->devfn << 8));
laddr[1] = laddr[2] = cpu_to_be32(0); laddr[1] = laddr[2] = cpu_to_be32(0);
return of_irq_parse_raw(laddr, out_irq); rc = of_irq_parse_raw(laddr, out_irq);
if (rc)
goto err;
return 0;
err:
dev_err(&pdev->dev, "of_irq_parse_pci() failed with rc=%d\n", rc);
return rc;
} }
EXPORT_SYMBOL_GPL(of_irq_parse_pci); EXPORT_SYMBOL_GPL(of_irq_parse_pci);
...@@ -105,10 +113,8 @@ int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin) ...@@ -105,10 +113,8 @@ int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin)
int ret; int ret;
ret = of_irq_parse_pci(dev, &oirq); ret = of_irq_parse_pci(dev, &oirq);
if (ret) { if (ret)
dev_err(&dev->dev, "of_irq_parse_pci() failed with rc=%d\n", ret);
return 0; /* Proper return code 0 == NO_IRQ */ return 0; /* Proper return code 0 == NO_IRQ */
}
return irq_create_of_mapping(&oirq); return irq_create_of_mapping(&oirq);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment