hw/qdev: Constify DeviceState* argument of qdev_get_parent_bus()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Sun, 12 Feb 2023 22:26:59 +0000 (23:26 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 27 Feb 2023 21:29:01 +0000 (22:29 +0100)
The structure is accessed read-only by qdev_get_parent_bus().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230212224730.51438-2-philmd@linaro.org>

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

index d759c4602c2597a1368bd2bd381bf4b519cfa0dd..43d863b0c5b002c7f0a46de2710b5a1a110717a7 100644 (file)
@@ -330,7 +330,7 @@ bool qdev_machine_modified(void)
     return qdev_hot_added || qdev_hot_removed;
 }
 
-BusState *qdev_get_parent_bus(DeviceState *dev)
+BusState *qdev_get_parent_bus(const DeviceState *dev)
 {
     return dev->parent_bus;
 }
index 35fddb19a649934568116d44a812dbebd7354842..f5b3b2f89a4943c4f1a69f3726717452d2bf2f58 100644 (file)
@@ -715,7 +715,7 @@ static inline void qdev_init_gpio_in_named(DeviceState *dev,
 void qdev_pass_gpios(DeviceState *dev, DeviceState *container,
                      const char *name);
 
-BusState *qdev_get_parent_bus(DeviceState *dev);
+BusState *qdev_get_parent_bus(const DeviceState *dev);
 
 /*** BUS API. ***/