summaryrefslogtreecommitdiff
path: root/zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2021-06-24 16:28:16 +0000
committerCommit Bot <commit-bot@chromium.org>2021-06-28 12:56:28 +0000
commitbcaeebb1efb5f26ee6ef63e19b97894a3b89ab22 (patch)
treed84514b1655a9725141ad4fd0eaa53b80bca2862 /zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c
parent3d5563af348f24cd21317252fdea2f2c87103f7e (diff)
downloadchrome-ec-bcaeebb1efb5f26ee6ef63e19b97894a3b89ab22.tar.gz
zephyr: drivers: use DEVICE_DT_INST_DEFINE for device definitions
Use DEVICE_DT_INST_DEFINE for drivers defined within the zephyr shim. This ensures that the static nodes used by DEVICE_DT_GET are defined and usable. BRANCH=none BUG=none TEST=zmake configure -b -B ~/build-volteer/ zephyr/projects/volteer/volteer TEST=zmake configure -b -B ~/build-it8xxx2_evb/ zephyr/projects/it8xxx2_evb Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Icc04e489cf3ecdcd68862e16dab025376602b7ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2985461 Reviewed-by: Yuval Peress <peress@chromium.org>
Diffstat (limited to 'zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c')
-rw-r--r--zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c b/zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c
index 138f3c0051..99164e46fd 100644
--- a/zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c
+++ b/zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c
@@ -231,10 +231,9 @@ static const struct cros_kb_raw_npcx_config cros_kb_raw_cfg = {
/* Verify there's exactly 1 enabled cros,kb-raw-npcx node. */
BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1);
-DEVICE_DEFINE(cros_kb_raw_npcx_0, DT_LABEL(DT_DRV_INST(0)), kb_raw_npcx_init,
- NULL, NULL, &cros_kb_raw_cfg, PRE_KERNEL_1,
- CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
- &cros_kb_raw_npcx_driver_api);
+DEVICE_DT_INST_DEFINE(0, kb_raw_npcx_init, NULL, NULL, &cros_kb_raw_cfg,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ &cros_kb_raw_npcx_driver_api);
/* KBS register structure check */
NPCX_REG_SIZE_CHECK(kbs_reg, 0x010);