This getter doesn't update any DeviceState internal fields,
make it const.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
include/hw/qdev-core.h | 3 ++-
hw/core/gpio.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index a7bfb10dc70..2caa0cbd26f 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -725,7 +725,8 @@ void qdev_connect_gpio_out_named(DeviceState *dev, const
char *name, int n,
*
* Return: qemu_irq associated with GPIO or NULL if un-wired.
*/
-qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, int
n);
+qemu_irq qdev_get_gpio_out_connector(const DeviceState *dev,
+ const char *name, int n);
/**
* qdev_intercept_gpio_out: Intercept an existing GPIO connection
diff --git a/hw/core/gpio.c b/hw/core/gpio.c
index 6e32a8eec61..c7c2936fc55 100644
--- a/hw/core/gpio.c
+++ b/hw/core/gpio.c
@@ -129,7 +129,8 @@ void qdev_connect_gpio_out_named(DeviceState *dev, const
char *name, int n,
g_free(propname);
}
-qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, int n)
+qemu_irq qdev_get_gpio_out_connector(const DeviceState *dev,
+ const char *name, int n)
{
g_autofree char *propname = g_strdup_printf("%s[%d]",
name ? name : "unnamed-gpio-out", n);
--
2.51.0