summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Massey <aaronmassey@google.com>2022-07-18 13:24:51 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-19 18:01:40 +0000
commit7ae9a8daffde9b5451dff964646323a6aa9a0f9a (patch)
treec28ec26e63c3a08a4c06bb60ba058bc4e10f0052
parent3f5963fd7c75715f168cc757329b4a4761729491 (diff)
downloadchrome-ec-7ae9a8daffde9b5451dff964646323a6aa9a0f9a.tar.gz
emul: Remove DT_INST_BUS_LABEL(n) usage
Zephyr upstream deprecated DT_BUS_LABEL(node_id) and DT_INST_BUS_LABEL(inst) macros causing a CQ build failure and blocking Zephyr downstreaming. Replace code occurrences of DT_INST_BUS_LABEL(inst) with DT_LABEL(DT_BUS(DT_DRV_INST(inst))). This macro was only used in emulators. BRANCH=none BUG=b:239447869 TEST=zmake test test-drivers # With breaking commit in downstreamed Zephyr Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: If745caeb1273c7e51331bd45b17dc28960c7f8da Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3767857 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Tristan Honscheid <honscheid@google.com>
-rw-r--r--zephyr/emul/emul_bb_retimer.c2
-rw-r--r--zephyr/emul/emul_bma255.c2
-rw-r--r--zephyr/emul/emul_bmi.c2
-rw-r--r--zephyr/emul/emul_isl923x.c2
-rw-r--r--zephyr/emul/emul_lis2dw12.c2
-rw-r--r--zephyr/emul/emul_ln9310.c2
-rw-r--r--zephyr/emul/emul_pi3usb9201.c2
-rw-r--r--zephyr/emul/emul_smart_battery.c2
-rw-r--r--zephyr/emul/emul_sn5s330.c2
-rw-r--r--zephyr/emul/emul_syv682x.c2
-rw-r--r--zephyr/emul/emul_tcs3400.c2
-rw-r--r--zephyr/emul/i2c_mock.c2
-rw-r--r--zephyr/emul/tcpc/emul_ps8xxx.c6
-rw-r--r--zephyr/include/emul/tcpc/emul_tcpci.h2
14 files changed, 16 insertions, 16 deletions
diff --git a/zephyr/emul/emul_bb_retimer.c b/zephyr/emul/emul_bb_retimer.c
index 8a9d8b5633..54402555bb 100644
--- a/zephyr/emul/emul_bb_retimer.c
+++ b/zephyr/emul/emul_bb_retimer.c
@@ -334,7 +334,7 @@ static int bb_emul_init(const struct emul *emul, const struct device *parent)
}; \
\
static const struct i2c_common_emul_cfg bb_emul_cfg_##n = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.data = &bb_emul_data_##n.common, \
.addr = DT_INST_REG_ADDR(n), \
diff --git a/zephyr/emul/emul_bma255.c b/zephyr/emul/emul_bma255.c
index afd9f5fb7b..ca75442156 100644
--- a/zephyr/emul/emul_bma255.c
+++ b/zephyr/emul/emul_bma255.c
@@ -1010,7 +1010,7 @@ static int bma_emul_init(const struct emul *emul, const struct device *parent)
}; \
\
static const struct i2c_common_emul_cfg bma_emul_cfg_##n = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.data = &bma_emul_data_##n.common, \
.addr = DT_INST_REG_ADDR(n), \
diff --git a/zephyr/emul/emul_bmi.c b/zephyr/emul/emul_bmi.c
index bdc440a36f..23f0bfddeb 100644
--- a/zephyr/emul/emul_bmi.c
+++ b/zephyr/emul/emul_bmi.c
@@ -1087,7 +1087,7 @@ static int bmi_emul_init(const struct emul *emul, const struct device *parent)
}; \
\
static const struct i2c_common_emul_cfg bmi_emul_cfg_##n = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.data = &bmi_emul_data_##n.common, \
.addr = DT_INST_REG_ADDR(n), \
diff --git a/zephyr/emul/emul_isl923x.c b/zephyr/emul/emul_isl923x.c
index cb6abd849e..8a49f569dc 100644
--- a/zephyr/emul/emul_isl923x.c
+++ b/zephyr/emul/emul_isl923x.c
@@ -434,7 +434,7 @@ static int emul_isl923x_init(const struct emul *emul,
}; \
static struct isl923x_emul_cfg isl923x_emul_cfg_##n = { \
.common = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.addr = DT_INST_REG_ADDR(n), \
}, \
diff --git a/zephyr/emul/emul_lis2dw12.c b/zephyr/emul/emul_lis2dw12.c
index 0d99585b8e..b0e85f50b5 100644
--- a/zephyr/emul/emul_lis2dw12.c
+++ b/zephyr/emul/emul_lis2dw12.c
@@ -304,7 +304,7 @@ void lis2dw12_emul_clear_accel_reading(const struct emul *emul)
}; \
static const struct lis2dw12_emul_cfg lis2dw12_emul_cfg_##n = { \
.common = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.addr = DT_INST_REG_ADDR(n), \
}, \
diff --git a/zephyr/emul/emul_ln9310.c b/zephyr/emul/emul_ln9310.c
index ae213ddebf..d66f23a1a5 100644
--- a/zephyr/emul/emul_ln9310.c
+++ b/zephyr/emul/emul_ln9310.c
@@ -506,7 +506,7 @@ static int emul_ln9310_init(const struct emul *emul,
.gpio_int_pin = LN9310_GET_GPIO_INT_PIN(n), \
}; \
static const struct i2c_common_emul_cfg ln9310_emul_cfg_##n = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.addr = DT_INST_REG_ADDR(n), \
}; \
diff --git a/zephyr/emul/emul_pi3usb9201.c b/zephyr/emul/emul_pi3usb9201.c
index ee33152b84..d98db3b3e8 100644
--- a/zephyr/emul/emul_pi3usb9201.c
+++ b/zephyr/emul/emul_pi3usb9201.c
@@ -171,7 +171,7 @@ static int pi3usb9201_emul_init(const struct emul *emul,
#define PI3USB9201_EMUL(n) \
static struct pi3usb9201_emul_data pi3usb9201_emul_data_##n = {}; \
static const struct pi3usb9201_emul_cfg pi3usb9201_emul_cfg_##n = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.data = &pi3usb9201_emul_data_##n, \
.addr = DT_INST_REG_ADDR(n), \
}; \
diff --git a/zephyr/emul/emul_smart_battery.c b/zephyr/emul/emul_smart_battery.c
index 8ba61c56c4..fd20997049 100644
--- a/zephyr/emul/emul_smart_battery.c
+++ b/zephyr/emul/emul_smart_battery.c
@@ -874,7 +874,7 @@ static int sbat_emul_init(const struct emul *emul, const struct device *parent)
}; \
\
static const struct i2c_common_emul_cfg sbat_emul_cfg_##n = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.data = &sbat_emul_data_##n.common, \
.addr = DT_INST_REG_ADDR(n), \
diff --git a/zephyr/emul/emul_sn5s330.c b/zephyr/emul/emul_sn5s330.c
index 1b58e8e9ad..b515b832a1 100644
--- a/zephyr/emul/emul_sn5s330.c
+++ b/zephyr/emul/emul_sn5s330.c
@@ -359,7 +359,7 @@ static int emul_sn5s330_init(const struct emul *emul,
}; \
static struct sn5s330_emul_cfg sn5s330_emul_cfg_##n = { \
.common = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.addr = DT_INST_REG_ADDR(n), \
}, \
diff --git a/zephyr/emul/emul_syv682x.c b/zephyr/emul/emul_syv682x.c
index 870b51dd52..ab7ba9ff91 100644
--- a/zephyr/emul/emul_syv682x.c
+++ b/zephyr/emul/emul_syv682x.c
@@ -279,7 +279,7 @@ static int syv682x_emul_init(const struct emul *emul,
}; \
static const struct syv682x_emul_cfg syv682x_emul_cfg_##n = { \
.common = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.addr = DT_INST_REG_ADDR(n), \
}, \
diff --git a/zephyr/emul/emul_tcs3400.c b/zephyr/emul/emul_tcs3400.c
index fe5d605232..0bb48fccd1 100644
--- a/zephyr/emul/emul_tcs3400.c
+++ b/zephyr/emul/emul_tcs3400.c
@@ -621,7 +621,7 @@ static int tcs_emul_init(const struct emul *emul, const struct device *parent)
}; \
\
static const struct i2c_common_emul_cfg tcs_emul_cfg_##n = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.data = &tcs_emul_data_##n.common, \
.addr = DT_INST_REG_ADDR(n), \
diff --git a/zephyr/emul/i2c_mock.c b/zephyr/emul/i2c_mock.c
index ecacf95369..207151ef6c 100644
--- a/zephyr/emul/i2c_mock.c
+++ b/zephyr/emul/i2c_mock.c
@@ -58,7 +58,7 @@ static int i2c_mock_init(const struct emul *emul, const struct device *parent)
#define INIT_I2C_MOCK(n) \
static const struct i2c_common_emul_cfg i2c_mock_cfg_##n = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.addr = DT_INST_REG_ADDR(n), \
}; \
diff --git a/zephyr/emul/tcpc/emul_ps8xxx.c b/zephyr/emul/tcpc/emul_ps8xxx.c
index 43e7c2fdd7..477070460f 100644
--- a/zephyr/emul/tcpc/emul_ps8xxx.c
+++ b/zephyr/emul/tcpc/emul_ps8xxx.c
@@ -583,19 +583,19 @@ static int ps8xxx_emul_init(const struct emul *emul,
\
static const struct ps8xxx_emul_cfg ps8xxx_emul_cfg_##n = { \
.p0_cfg = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.data = &ps8xxx_emul_data_##n.p0_data, \
.addr = DT_INST_PROP(n, p0_i2c_addr), \
}, \
.p1_cfg = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.data = &ps8xxx_emul_data_##n.p1_data, \
.addr = DT_INST_PROP(n, p1_i2c_addr), \
}, \
.gpio_cfg = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.data = &ps8xxx_emul_data_##n.gpio_data, \
.addr = DT_INST_PROP(n, gpio_i2c_addr), \
diff --git a/zephyr/include/emul/tcpc/emul_tcpci.h b/zephyr/include/emul/tcpc/emul_tcpci.h
index f819a60567..9841915d1e 100644
--- a/zephyr/include/emul/tcpc/emul_tcpci.h
+++ b/zephyr/include/emul/tcpc/emul_tcpci.h
@@ -117,7 +117,7 @@ struct tcpc_emul_data {
.tcpci_ctx = &tcpci_ctx##n, \
.chip_data = chip_data_ptr, \
.i2c_cfg = { \
- .i2c_label = DT_INST_BUS_LABEL(n), \
+ .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \
.dev_label = DT_INST_LABEL(n), \
.data = &tcpci_ctx##n.common, \
.addr = DT_INST_REG_ADDR(n), \