Skip to content

Commit bbaf7a0

Browse files
shentokphilmd
authored andcommitted
tests/qtest/libqos: Reuse TYPE_IMX_I2C define
Signed-off-by: Bernhard Beschow <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Fabiano Rosas <[email protected]> Message-ID: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
1 parent 2ee8c2c commit bbaf7a0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tests/qtest/libqos/arm-imx25-pdk-machine.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "libqos-malloc.h"
2424
#include "qgraph.h"
2525
#include "i2c.h"
26+
#include "hw/i2c/imx_i2c.h"
2627

2728
#define ARM_PAGE_SIZE 4096
2829
#define IMX25_PDK_RAM_START 0x80000000
@@ -50,7 +51,7 @@ static void *imx25_pdk_get_driver(void *object, const char *interface)
5051
static QOSGraphObject *imx25_pdk_get_device(void *obj, const char *device)
5152
{
5253
QIMX25PDKMachine *machine = obj;
53-
if (!g_strcmp0(device, "imx.i2c")) {
54+
if (!g_strcmp0(device, TYPE_IMX_I2C)) {
5455
return &machine->i2c_1.obj;
5556
}
5657

@@ -86,7 +87,7 @@ static void imx25_pdk_register_nodes(void)
8687
.extra_device_opts = "bus=i2c-bus.0"
8788
};
8889
qos_node_create_machine("arm/imx25-pdk", qos_create_machine_arm_imx25_pdk);
89-
qos_node_contains("arm/imx25-pdk", "imx.i2c", &edge, NULL);
90+
qos_node_contains("arm/imx25-pdk", TYPE_IMX_I2C, &edge, NULL);
9091
}
9192

9293
libqos_init(imx25_pdk_register_nodes);

tests/qtest/libqos/i2c-imx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ void imx_i2c_init(IMXI2C *s, QTestState *qts, uint64_t addr)
209209

210210
static void imx_i2c_register_nodes(void)
211211
{
212-
qos_node_create_driver("imx.i2c", NULL);
213-
qos_node_produces("imx.i2c", "i2c-bus");
212+
qos_node_create_driver(TYPE_IMX_I2C, NULL);
213+
qos_node_produces(TYPE_IMX_I2C, "i2c-bus");
214214
}
215215

216216
libqos_init(imx_i2c_register_nodes);

0 commit comments

Comments
 (0)