From 5d9859ffa6bc1687818bbc3c955a20c7e0a2db07 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Thu, 24 Jun 2021 16:46:31 +0000 Subject: zephyr: shim: use DEVICE_DT_GET for clock control This changes the clock control calls to use DEVICE_DT_GET instead of device_get_binding. DEVICE_DT_GET is more efficient since it's allocated at link time. These are then used by clock_control_on, which already checks for device_is_ready, so no extra safety checks are needed. 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 Change-Id: I76a2c47165d197c799be25d8e7e40a1a0873777d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2985462 Reviewed-by: Yuval Peress --- zephyr/shim/chip/npcx/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zephyr/shim/chip/npcx') diff --git a/zephyr/shim/chip/npcx/clock.c b/zephyr/shim/chip/npcx/clock.c index 24ae45d107..cd483682b8 100644 --- a/zephyr/shim/chip/npcx/clock.c +++ b/zephyr/shim/chip/npcx/clock.c @@ -22,7 +22,7 @@ LOG_MODULE_REGISTER(shim_clock, LOG_LEVEL_ERR); int clock_get_freq(void) { - const struct device *clk_dev = device_get_binding(NPCX_CLK_CTRL_NAME); + const struct device *clk_dev = DEVICE_DT_GET(DT_NODELABEL(pcc)); const struct npcx_clk_cfg clk_cfg = { .bus = NPCX_CLOCK_BUS_CORE, }; -- cgit v1.2.1