From: Philippe Mathieu-Daudé Date: Fri, 24 Oct 2025 14:49:52 +0000 (+0200) Subject: hw/qdev: Have qdev_get_gpio_out_connector() take const DeviceState arg X-Git-Tag: v10.2.0-rc1~41^2~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=980f677c1ebb0a2f759f287b18245ac01682201c;p=thirdparty%2Fqemu.git hw/qdev: Have qdev_get_gpio_out_connector() take const DeviceState arg 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> --- 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