Commit 9ea8e3e4 authored by Julien's avatar Julien

libxdma: check legacy interrupt support

If pci_read_config_byte of register PCI_INTERRUPT_PIN returns 0, it
means that legacy interrupts are not supported so return an error
instead of trying to request an interrupt with val = 0.
parent d87e1c53
......@@ -2316,6 +2316,11 @@ static int irq_legacy_setup(struct xdma_dev *xdev, struct pci_dev *pdev)
int rv;
pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &val);
if (val == 0) {
dbg_init("Legacy interrupt not supported\n");
return -EINVAL;
}
dbg_init("Legacy Interrupt register value = %d\n", val);
if (val > 1) {
val--;
......
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