@@ -73,7 +73,12 @@ typedef void FindSysbusDeviceFunc(SysBusDevice *sbdev, void *opaque);
void sysbus_init_mmio(SysBusDevice *dev, MemoryRegion *memory);
MemoryRegion *sysbus_mmio_get_region(SysBusDevice *dev, int n);
void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p);
-void sysbus_pass_irq(SysBusDevice *dev, SysBusDevice *target);
+/**
+ * sysbus_pass_irq: Pass through IRQ/GPIO lines from one to another device
+ * @to_dev: Device which needs to expose IRQ/GPIO lines
+ * @from_dev: Device which has the IRQ/GPIO lines
+ */
+void sysbus_pass_irq(SysBusDevice *to_dev, SysBusDevice *from_dev);
void sysbus_init_ioports(SysBusDevice *dev, uint32_t ioport, uint32_t size);
@@ -181,10 +181,9 @@ void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p)
qdev_init_gpio_out_named(DEVICE(dev), p, SYSBUS_DEVICE_GPIO_IRQ, 1);
}
-/* Pass IRQs from a target device. */
-void sysbus_pass_irq(SysBusDevice *dev, SysBusDevice *target)
+void sysbus_pass_irq(SysBusDevice *to_dev, SysBusDevice *from_dev)
{
- qdev_pass_gpios(DEVICE(target), DEVICE(dev), SYSBUS_DEVICE_GPIO_IRQ);
+ qdev_pass_gpios(DEVICE(from_dev), DEVICE(to_dev), SYSBUS_DEVICE_GPIO_IRQ);
}
void sysbus_init_mmio(SysBusDevice *dev, MemoryRegion *memory)
Make the direction sysbus_pass_irq() pass the GPIOs more obvious by renaming its arguments as 'from_dev' and 'to_dev'. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- include/hw/sysbus.h | 7 ++++++- hw/core/sysbus.c | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-)