]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/qdev: Have qdev_get_gpio_out_connector() take const DeviceState arg
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 24 Oct 2025 14:49:52 +0000 (16:49 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 28 Oct 2025 07:19:18 +0000 (08:19 +0100)
This getter doesn't update any DeviceState internal fields,
make it const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20251024190416.8803-2-philmd@linaro.org>

hw/core/gpio.c
include/hw/qdev-core.h

index 6e32a8eec61f9a35bf5e2f2ac369f57756e3dafa..c7c2936fc55cd9691c7a276ddabeb2e0a8b6a874 100644 (file)
@@ -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);
index a7bfb10dc70c73f953338e78bde4905bf067064c..2caa0cbd26f5648a44c61668cfa4fd8ab46d9e07 100644 (file)
@@ -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