On 18/2/22 09:18, Cédric Le Goater wrote:
This unifies the way we create the pca9552 devices on the different boards.

Suggested-by: Philippe Mathieu-Daudé <f4...@amsat.org>
Signed-off-by: Cédric Le Goater <c...@kaod.org>
---
  hw/arm/aspeed.c | 49 +++++++++++++++++++++++++++----------------------
  1 file changed, 27 insertions(+), 22 deletions(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index f71a5d87473f..11558b327bc9 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -533,6 +533,12 @@ static void romulus_bmc_i2c_init(AspeedMachineState *bmc)
      i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 
0x32);
  }
+static void create_pca9552(AspeedSoCState *soc, int bus_id, int addr)
+{
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, bus_id),
+                            TYPE_PCA9552, addr);
+}

Hmm in case you respin, this is an opportunity to return the I2CSlave*
pointer here.

Reply via email to