summaryrefslogtreecommitdiff
path: root/hw/i2c.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-23 15:34:39 -0600
committerAndreas Färber <afaerber@suse.de>2012-06-18 15:14:38 +0200
commit0866aca1de15a12547f52ff8563cf7c163e1898e (patch)
tree511c043eb3de19d479f708209e588d828b751903 /hw/i2c.c
parentf968fc6892daf02865cce8af277cc755be690eda (diff)
downloadqemu-0866aca1de15a12547f52ff8563cf7c163e1898e.tar.gz
qbus: Make child devices links
Make qbus children show up as link<> properties. There is no stable addressing for qbus children so we use an unstable naming convention. This is okay in QOM though because the composition name is expected to be what's stable. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/i2c.c')
-rw-r--r--hw/i2c.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/i2c.c b/hw/i2c.c
index 319b249da3..296bece119 100644
--- a/hw/i2c.c
+++ b/hw/i2c.c
@@ -86,11 +86,12 @@ int i2c_bus_busy(i2c_bus *bus)
/* TODO: Make this handle multiple masters. */
int i2c_start_transfer(i2c_bus *bus, uint8_t address, int recv)
{
- DeviceState *qdev;
+ BusChild *kid;
I2CSlave *slave = NULL;
I2CSlaveClass *sc;
- QTAILQ_FOREACH(qdev, &bus->qbus.children, sibling) {
+ QTAILQ_FOREACH(kid, &bus->qbus.children, sibling) {
+ DeviceState *qdev = kid->child;
I2CSlave *candidate = I2C_SLAVE_FROM_QDEV(qdev);
if (candidate->address == address) {
slave = candidate;