qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] hw/core/sysbus: Make sysbus_pass_irq() arguments self-descri


From: Philippe Mathieu-Daudé
Subject: [PATCH 2/2] hw/core/sysbus: Make sysbus_pass_irq() arguments self-describing
Date: Tue, 18 Aug 2020 16:38:25 +0200

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(-)

diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h
index da9f85c58ce..65de6f6b062 100644
--- a/include/hw/sysbus.h
+++ b/include/hw/sysbus.h
@@ -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);
 
 
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index 70239b7e7d0..bc23a66b5c5 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -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)
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]