Patchwork [1/2] pci_bridge: Use a default map_irq function

login
register
mail settings
Submitter Alex Williamson
Date March 7, 2013, 11:16 p.m.
Message ID <20130307231654.31144.71041.stgit@bling.home>
Download mbox | patch
Permalink /patch/226001/
State New
Headers show

Comments

Alex Williamson - March 7, 2013, 11:16 p.m.
The PCI bridge spec defines a default swizzle for translating INTx
IRQs from secondary bus to primary.  Use this by default for any
bridge that doesn't set a function.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 hw/pci/pci_bridge.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c
index 84e7c19..5d27fa2 100644
--- a/hw/pci/pci_bridge.c
+++ b/hw/pci/pci_bridge.c
@@ -367,7 +367,7 @@  int pci_bridge_initfn(PCIDevice *dev)
     qbus_create_inplace(&sec_bus->qbus, TYPE_PCI_BUS, &dev->qdev,
                         br->bus_name);
     sec_bus->parent_dev = dev;
-    sec_bus->map_irq = br->map_irq;
+    sec_bus->map_irq = br->map_irq ? br->map_irq : pci_swizzle_map_irq_fn;
     sec_bus->address_space_mem = &br->address_space_mem;
     memory_region_init(&br->address_space_mem, "pci_bridge_pci", INT64_MAX);
     sec_bus->address_space_io = &br->address_space_io;