summaryrefslogtreecommitdiffstats
path: root/hw/i2c/core.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2020-07-06 00:41:52 +0200
committerCorey Minyard2020-07-16 19:30:54 +0200
commit2616f57231c8e065df77de894a8f018cd1842c95 (patch)
treed54c2111e6e60034bd4a21c8d84d7833f4becd31 /hw/i2c/core.c
parenthw/i2c: Rename i2c_try_create_slave() as i2c_slave_new() (diff)
downloadqemu-2616f57231c8e065df77de894a8f018cd1842c95.tar.gz
qemu-2616f57231c8e065df77de894a8f018cd1842c95.tar.xz
qemu-2616f57231c8e065df77de894a8f018cd1842c95.zip
hw/i2c: Rename i2c_realize_and_unref() as i2c_slave_realize_and_unref()
The other i2c functions are called i2c_slave_FOO(). Rename as i2c_slave_realize_and_unref() to be consistent. Suggested-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20200705224154.16917-4-f4bug@amsat.org> Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'hw/i2c/core.c')
-rw-r--r--hw/i2c/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/i2c/core.c b/hw/i2c/core.c
index 144786f17a..f81601a5b9 100644
--- a/hw/i2c/core.c
+++ b/hw/i2c/core.c
@@ -276,16 +276,16 @@ I2CSlave *i2c_slave_new(const char *name, uint8_t addr)
return I2C_SLAVE(dev);
}
-bool i2c_realize_and_unref(DeviceState *dev, I2CBus *bus, Error **errp)
+bool i2c_slave_realize_and_unref(I2CSlave *dev, I2CBus *bus, Error **errp)
{
- return qdev_realize_and_unref(dev, &bus->qbus, errp);
+ return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp);
}
DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr)
{
I2CSlave *dev = i2c_slave_new(name, addr);
- i2c_realize_and_unref(DEVICE(dev), bus, &error_fatal);
+ i2c_slave_realize_and_unref(dev, bus, &error_fatal);
return DEVICE(dev);
}