From 80cacc3d251ba738e2c8e6a84305ac06395898ef Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 18 Feb 2021 15:06:36 -0700 Subject: zephyr: Drop use of DEVICE_AND_API_INIT() in drivers/cros* This macro is deprecated in v2.5. Replace it with DEVICE_DEFINE(). BUG=b:180409973 BRANCH=none TEST=build for volteer and see the warnings are gone Change-Id: Ie790e89b2f9933db22776f536948541ee288716e Signed-off-by: Simon Glass Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2705446 Reviewed-by: Keith Short --- zephyr/drivers/cros_bbram/cros_bbram_npcx.c | 10 +++++----- zephyr/drivers/cros_flash/cros_flash_npcx.c | 7 +++---- zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c | 8 ++++---- zephyr/drivers/cros_system/cros_system_npcx.c | 6 +++--- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/zephyr/drivers/cros_bbram/cros_bbram_npcx.c b/zephyr/drivers/cros_bbram/cros_bbram_npcx.c index 3caeae958a..255cc22654 100644 --- a/zephyr/drivers/cros_bbram/cros_bbram_npcx.c +++ b/zephyr/drivers/cros_bbram/cros_bbram_npcx.c @@ -121,10 +121,10 @@ static int bbram_npcx_init(const struct device *dev) .size = DT_INST_REG_SIZE_BY_NAME(inst, memory), \ .status_reg_addr = DT_INST_REG_ADDR_BY_NAME(inst, status), \ }; \ - DEVICE_AND_API_INIT(cros_bbram_npcx_##inst, DT_INST_LABEL(inst), \ - bbram_npcx_init, &cros_bbram_data_##inst, \ - &cros_bbram_cfg_##inst, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ - &cros_bbram_npcx_driver_api); + DEVICE_DEFINE(cros_bbram_npcx_##inst, DT_INST_LABEL(inst), \ + bbram_npcx_init, NULL, &cros_bbram_data_##inst, \ + &cros_bbram_cfg_##inst, PRE_KERNEL_1, \ + CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ + &cros_bbram_npcx_driver_api); DT_INST_FOREACH_STATUS_OKAY(CROS_BBRAM_INIT); diff --git a/zephyr/drivers/cros_flash/cros_flash_npcx.c b/zephyr/drivers/cros_flash/cros_flash_npcx.c index 3fd8f4edb9..0afc6739e7 100644 --- a/zephyr/drivers/cros_flash/cros_flash_npcx.c +++ b/zephyr/drivers/cros_flash/cros_flash_npcx.c @@ -519,7 +519,6 @@ static const struct cros_flash_npcx_config cros_flash_cfg = { static struct cros_flash_npcx_data cros_flash_data; -DEVICE_AND_API_INIT(cros_flash_npcx_0, DT_INST_LABEL(0), flash_npcx_init, - &cros_flash_data, &cros_flash_cfg, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, - &cros_flash_npcx_driver_api); +DEVICE_DEFINE(cros_flash_npcx_0, DT_INST_LABEL(0), flash_npcx_init, NULL, + &cros_flash_data, &cros_flash_cfg, PRE_KERNEL_1, + CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &cros_flash_npcx_driver_api); 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 91e8c849df..258fb58e5d 100644 --- a/zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c +++ b/zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c @@ -230,10 +230,10 @@ static const struct cros_kb_raw_npcx_config cros_kb_raw_cfg = { .wui_maps = NPCX_DT_WUI_ITEMS_LIST(0), }; -DEVICE_AND_API_INIT(cros_kb_raw_npcx_0, DT_INST_LABEL(0), kb_raw_npcx_init, - NULL, &cros_kb_raw_cfg, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, - &cros_kb_raw_npcx_driver_api); +DEVICE_DEFINE(cros_kb_raw_npcx_0, DT_INST_LABEL(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); diff --git a/zephyr/drivers/cros_system/cros_system_npcx.c b/zephyr/drivers/cros_system/cros_system_npcx.c index 619acaddb5..87db955e4a 100644 --- a/zephyr/drivers/cros_system/cros_system_npcx.c +++ b/zephyr/drivers/cros_system/cros_system_npcx.c @@ -73,6 +73,6 @@ static const struct cros_system_driver_api cros_system_driver_npcx_api = { * The priority of cros_system_npcx_init() should be lower than watchdog init * for reset cause check. */ -DEVICE_AND_API_INIT(cros_system_npcx_0, "CROS_SYSTEM", cros_system_npcx_init, - &cros_system_npcx_dev_data, &cros_system_dev_cfg, - PRE_KERNEL_1, 30, &cros_system_driver_npcx_api); +DEVICE_DEFINE(cros_system_npcx_0, "CROS_SYSTEM", cros_system_npcx_init, NULL, + &cros_system_npcx_dev_data, &cros_system_dev_cfg, PRE_KERNEL_1, + 30, &cros_system_driver_npcx_api); -- cgit v1.2.1