diff options
author | Abe Levkoy <alevkoy@chromium.org> | 2022-08-02 13:10:20 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-08-03 20:07:24 +0000 |
commit | 9d346066594745ad1ce465890f60b5db0e6615a1 (patch) | |
tree | 1c0c28d83c89dd9267d47f7d3a8b2532b5234c99 /zephyr/emul/i2c_mock.c | |
parent | e372db6463482ff5a9da7957c9b411a35cd3b33f (diff) | |
download | chrome-ec-9d346066594745ad1ce465890f60b5db0e6615a1.tar.gz |
zephyr: emul: Use EMUL_DT_INST_DEFINE
Update the emulators to use EMUL_DT_INST_DEFINE and EMUL_DT_GET instead
of EMUL_DEFINE and EMUL_REG_NAME, because the latter have been removed
upstream.
BUG=b:224588313
TEST=zmake testall
BRANCH=none
Cq-Depend: chromium:3806745
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: If358bd2bcfe9b99df0a671e2542a94deb5fad8f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3805535
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Diffstat (limited to 'zephyr/emul/i2c_mock.c')
-rw-r--r-- | zephyr/emul/i2c_mock.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/zephyr/emul/i2c_mock.c b/zephyr/emul/i2c_mock.c index d4b257731c..d471aa0b92 100644 --- a/zephyr/emul/i2c_mock.c +++ b/zephyr/emul/i2c_mock.c @@ -56,15 +56,15 @@ static int i2c_mock_init(const struct emul *emul, const struct device *parent) return 0; } -#define INIT_I2C_MOCK(n) \ - static const struct i2c_common_emul_cfg i2c_mock_cfg_##n = { \ - .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \ - .dev_label = DT_INST_LABEL(n), \ - .addr = DT_INST_REG_ADDR(n), \ - }; \ - static struct i2c_common_emul_data i2c_mock_data_##n; \ - EMUL_DEFINE(i2c_mock_init, DT_DRV_INST(n), &i2c_mock_cfg_##n, \ - &i2c_mock_data_##n, &i2c_common_emul_api) +#define INIT_I2C_MOCK(n) \ + static const struct i2c_common_emul_cfg i2c_mock_cfg_##n = { \ + .i2c_label = DT_LABEL(DT_BUS(DT_DRV_INST(n))), \ + .dev_label = DT_INST_LABEL(n), \ + .addr = DT_INST_REG_ADDR(n), \ + }; \ + static struct i2c_common_emul_data i2c_mock_data_##n; \ + EMUL_DT_INST_DEFINE(n, i2c_mock_init, &i2c_mock_data_##n, \ + &i2c_mock_cfg_##n, &i2c_common_emul_api) DT_INST_FOREACH_STATUS_OKAY(INIT_I2C_MOCK) |