aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/core/qdev-clock.c1
-rw-r--r--include/hw/qdev-clock.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/hw/core/qdev-clock.c b/hw/core/qdev-clock.c
index f139b68..47ecb5b 100644
--- a/hw/core/qdev-clock.c
+++ b/hw/core/qdev-clock.c
@@ -186,5 +186,6 @@ Clock *qdev_alias_clock(DeviceState *dev, const char *name,
void qdev_connect_clock_in(DeviceState *dev, const char *name, Clock *source)
{
+ assert(!dev->realized);
clock_set_source(qdev_get_clock_in(dev, name), source);
}
diff --git a/include/hw/qdev-clock.h b/include/hw/qdev-clock.h
index a897f7c..64ca4d2 100644
--- a/include/hw/qdev-clock.h
+++ b/include/hw/qdev-clock.h
@@ -70,6 +70,8 @@ Clock *qdev_get_clock_out(DeviceState *dev, const char *name);
*
* Set the source clock of input clock @name of device @dev to @source.
* @source period update will be propagated to @name clock.
+ *
+ * Must be called before @dev is realized.
*/
void qdev_connect_clock_in(DeviceState *dev, const char *name, Clock *source);