From a152f147db5a5d98e2b4259a865b3743f8f3159d Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 15 Apr 2020 06:31:07 -0500 Subject: [PATCH] drivers: ipm: ipm_nrfx_ipc: Convert to new DT_INST macros Convert older DT_INST_ macro use the new include/devicetree.h DT_INST macro APIs. Signed-off-by: Kumar Gala --- drivers/ipm/ipm_nrfx_ipc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/ipm/ipm_nrfx_ipc.c b/drivers/ipm/ipm_nrfx_ipc.c index 21683a14836..c896c9085fe 100644 --- a/drivers/ipm/ipm_nrfx_ipc.c +++ b/drivers/ipm/ipm_nrfx_ipc.c @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define DT_DRV_COMPAT nordic_nrf_ipc + #include #include #include @@ -82,10 +84,10 @@ static int ipm_nrf_set_enabled(struct device *dev, int enable) { /* Enable configured channels */ if (enable) { - irq_enable(DT_INST_0_NORDIC_NRF_IPC_IRQ_0); + irq_enable(DT_INST_IRQN(0)); nrfx_ipc_receive_event_group_enable((uint32_t)IPC_EVENT_BITS); } else { - irq_disable(DT_INST_0_NORDIC_NRF_IPC_IRQ_0); + irq_disable(DT_INST_IRQN(0)); nrfx_ipc_receive_event_group_disable((uint32_t)IPC_EVENT_BITS); } return 0; @@ -105,7 +107,7 @@ static const struct ipm_driver_api ipm_nrf_driver_api = { .set_enabled = ipm_nrf_set_enabled }; -DEVICE_AND_API_INIT(ipm_nrf, DT_INST_0_NORDIC_NRF_IPC_LABEL, +DEVICE_AND_API_INIT(ipm_nrf, DT_INST_LABEL(0), ipm_nrf_init, NULL, NULL, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &ipm_nrf_driver_api); @@ -205,7 +207,7 @@ static int vipm_nrf_##_idx##_set_enabled(struct device *dev, int enable)\ LOG_ERR("IPM_" #_idx " is TX message channel"); \ return -EINVAL; \ } else if (enable) { \ - irq_enable(DT_INST_0_NORDIC_NRF_IPC_IRQ_0); \ + irq_enable(DT_INST_IRQN(0)); \ nrfx_ipc_receive_event_enable(_idx); \ } else if (!enable) { \ nrfx_ipc_receive_event_disable(_idx); \ @@ -241,8 +243,8 @@ static void gipm_init(void) #else nrfx_ipc_init(0, vipm_dispatcher, (void *)&nrfx_ipm_data); #endif - IRQ_CONNECT(DT_INST_0_NORDIC_NRF_IPC_IRQ_0, - DT_INST_0_NORDIC_NRF_IPC_IRQ_0_PRIORITY, + IRQ_CONNECT(DT_INST_IRQN(0), + DT_INST_IRQ(0, priority), nrfx_isr, nrfx_ipc_irq_handler, 0); /* Set up signals and channels */