OSDN Git Service

hw/i2c/core: Add i2c_try_create_slave() and i2c_realize_and_unref()
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 23 Jun 2020 07:27:15 +0000 (09:27 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 26 Jun 2020 13:30:28 +0000 (14:30 +0100)
commitd88c42ff2c5cdcaecd02e6b31ea4c134b02be084
treeee9b50996fdb17426277fbc50dc609db41f2144c
parent888b2b034a29fa8fe99417c9665e0d671a9f33fb
hw/i2c/core: Add i2c_try_create_slave() and i2c_realize_and_unref()

Extract i2c_try_create_slave() and i2c_realize_and_unref()
from i2c_create_slave().
We can now set properties on a I2CSlave before it is realized.

This is in line with the recent qdev/QOM changes merged
in commit 6675a653d2e.

Reviewed-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Tested-by: Cédric Le Goater <clg@kaod.org>
Message-id: 20200623072723.6324-2-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/i2c/core.c
include/hw/i2c/i2c.h