From 980f677c1ebb0a2f759f287b18245ac01682201c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 24 Oct 2025 16:49:52 +0200 Subject: [PATCH] hw/qdev: Have qdev_get_gpio_out_connector() take const DeviceState arg MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This getter doesn't update any DeviceState internal fields, make it const. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Message-Id: <20251024190416.8803-2-philmd@linaro.org> --- hw/core/gpio.c | 3 ++- include/hw/qdev-core.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/core/gpio.c b/hw/core/gpio.c index 6e32a8eec6..c7c2936fc5 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); diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index a7bfb10dc7..2caa0cbd26 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 -- 2.47.3