drivers: npcx: convert NPCX drivers clock client to DEVICE_DT_GET

Convert the various device_get_binding() calls used to get the device
clock node to use DEVICE_DT_GET. The latter is processed at link time,
so it should be a bit more efficient.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2021-06-25 15:56:58 +00:00 committed by Anas Nashif
commit 3af832868c
10 changed files with 12 additions and 21 deletions

View file

@ -853,7 +853,7 @@ static int espi_npcx_init(const struct device *dev)
const struct espi_npcx_config *const config = DRV_CONFIG(dev);
struct espi_npcx_data *const data = DRV_DATA(dev);
struct espi_reg *const inst = HAL_INSTANCE(dev);
const struct device *clk_dev = device_get_binding(NPCX_CLK_CTRL_NAME);
const struct device *const clk_dev = DEVICE_DT_GET(NPCX_CLK_CTRL_NODE);
int i, ret;
/* Turn on eSPI device clock first */

View file

@ -979,8 +979,7 @@ int npcx_host_init_subs_core_domain(const struct device *host_bus_dev,
{
struct mswc_reg *const inst_mswc = host_sub_cfg.inst_mswc;
struct shm_reg *const inst_shm = host_sub_cfg.inst_shm;
const struct device *const clk_dev =
device_get_binding(NPCX_CLK_CTRL_NAME);
const struct device *const clk_dev = DEVICE_DT_GET(NPCX_CLK_CTRL_NODE);
int i;
uint8_t shm_sts;