Skip to content

Commit ba6138d

Browse files
galaknashif
authored andcommitted
drivers: clock_control: npcx: Convert to use DEVICE_DT_INST_DEFINE
The NPCX clock driver was already using devicetree, just need to make a small tweak to use DEVICE_DT_INST_DEFINE and update NPCX_CLK_CTRL_NAME to match the label for the "nuvoton,npcx-pcc" clock controller. Signed-off-by: Kumar Gala <[email protected]>
1 parent f6b7dd0 commit ba6138d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/clock_control/clock_control_npcx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const struct npcx_pcc_config pcc_config = {
160160
.base_pmc = DT_INST_REG_ADDR_BY_NAME(0, pmc),
161161
};
162162

163-
DEVICE_DEFINE(npcx_cdcg, NPCX_CLK_CTRL_NAME,
163+
DEVICE_DT_INST_DEFINE(0,
164164
&npcx_clock_control_init,
165165
device_pm_control_nop,
166166
NULL, &pcc_config,

soc/arm/nuvoton_npcx/common/soc_clock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern "C" {
1212
#endif
1313

1414
/* Common clock control device name for all NPCX series */
15-
#define NPCX_CLK_CTRL_NAME "npcx-cc"
15+
#define NPCX_CLK_CTRL_NAME DT_LABEL(DT_NODELABEL(pcc))
1616

1717
/**
1818
* @brief NPCX clock configuration structure

0 commit comments

Comments
 (0)