OSDN Git Service

hw/i2c: name I2CNode list in I2CBus
authorPatrick Venture <venture@google.com>
Mon, 12 Apr 2021 19:45:19 +0000 (12:45 -0700)
committerCorey Minyard <cminyard@mvista.com>
Thu, 15 Apr 2021 12:09:19 +0000 (07:09 -0500)
To enable passing the current_devs field as a parameter, we need to use
a named struct type.

Tested: BMC firmware with i2c devices booted to userspace.

Signed-off-by: Patrick Venture <venture@google.com>
Reviewed-by: Hao Wu <wuhaotsh@google.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210412194522.664594-2-venture@google.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
include/hw/i2c/i2c.h

index 277dd9f..1f7c268 100644 (file)
@@ -58,9 +58,11 @@ struct I2CNode {
     QLIST_ENTRY(I2CNode) next;
 };
 
+typedef QLIST_HEAD(I2CNodeList, I2CNode) I2CNodeList;
+
 struct I2CBus {
     BusState qbus;
-    QLIST_HEAD(, I2CNode) current_devs;
+    I2CNodeList current_devs;
     uint8_t saved_address;
     bool broadcast;
 };