Skip to content

Commit 4dd143f

Browse files
committed
driver: i2c: npcx: Convert drivers to new DT device macros
Convert i2c npcx drivers from: DEVICE_AND_API_INIT -> DEVICE_DT_DEFINE DEVICE_GET -> DEVICE_DT_GET Signed-off-by: Kumar Gala <[email protected]>
1 parent 478ddde commit 4dd143f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/i2c/i2c_npcx_controller.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ static int i2c_ctrl_init(const struct device *dev)
874874
IRQ_CONNECT(DT_INST_IRQN(inst), \
875875
DT_INST_IRQ(inst, priority), \
876876
i2c_ctrl_isr, \
877-
DEVICE_GET(i2c_ctrl_##inst), \
877+
DEVICE_DT_INST_GET(inst), \
878878
0); \
879879
irq_enable(DT_INST_IRQN(inst)); \
880880
\
@@ -893,8 +893,9 @@ static int i2c_ctrl_init(const struct device *dev)
893893
\
894894
static struct i2c_ctrl_data i2c_ctrl_data_##inst; \
895895
\
896-
DEVICE_AND_API_INIT(i2c_ctrl_##inst, DT_INST_LABEL(inst), \
896+
DEVICE_DT_INST_DEFINE(inst, \
897897
NPCX_I2C_CTRL_INIT_FUNC(inst), \
898+
device_pm_control_nop, \
898899
&i2c_ctrl_data_##inst, &i2c_ctrl_cfg_##inst, \
899900
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
900901
NULL); \

drivers/i2c/i2c_npcx_port.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,9 @@ static const struct i2c_driver_api i2c_port_npcx_driver_api = {
172172
\
173173
static struct i2c_npcx_port_data i2c_npcx_port_data_##inst; \
174174
\
175-
DEVICE_AND_API_INIT(i2c_npcx_port_##inst, DT_INST_LABEL(inst), \
175+
DEVICE_DT_INST_DEFINE(inst, \
176176
NPCX_I2C_PORT_INIT_FUNC(inst), \
177+
device_pm_control_nop, \
177178
&i2c_npcx_port_data_##inst, \
178179
&i2c_npcx_port_cfg_##inst, \
179180
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \

0 commit comments

Comments
 (0)