Skip to content

Commit ca304fa

Browse files
committed
drivers: gpio: renesas_ra: Allow to not specify any interrupt-names.
Fixes compilation when none of interrupts are specified for io_ports. In practice every RA-series soc will have IRQs, yet it is convinient still to be able to build code during development of DTS. Signed-off-by: Piotr Rak <[email protected]>
1 parent dd510cd commit ca304fa

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/gpio/gpio_renesas_ra.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static inline uint32_t gpio_ra_irq_info_event(const struct gpio_ra_irq_info *inf
7979
return ((info->flags & RA_ICU_FLAG_EVENT_MASK) >> RA_ICU_FLAG_EVENT_OFFSET);
8080
}
8181

82-
static void gpio_ra_isr(const struct device *dev, uint32_t port_irq)
82+
__unused static void gpio_ra_isr(const struct device *dev, uint32_t port_irq)
8383
{
8484
struct gpio_ra_data *data = dev->data;
8585
const struct gpio_ra_pin_irq_info *pin_irq = &data->port_irq_info[port_irq];
@@ -414,10 +414,13 @@ static const struct gpio_driver_api gpio_ra_driver_api = {
414414

415415
#define GPIO_RA_INIT(idx) \
416416
static struct gpio_ra_data gpio_ra_data_##idx = {}; \
417-
DT_INST_FOREACH_PROP_ELEM(idx, interrupt_names, GPIO_RA_DECL_PINS); \
418-
DT_INST_FOREACH_PROP_ELEM(idx, interrupt_names, GPIO_RA_ISR_DECL); \
417+
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, interrupt_names), \
418+
(DT_INST_FOREACH_PROP_ELEM(idx, interrupt_names, GPIO_RA_DECL_PINS)), ()); \
419+
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, interrupt_names), \
420+
(DT_INST_FOREACH_PROP_ELEM(idx, interrupt_names, GPIO_RA_ISR_DECL)), ()); \
419421
struct gpio_ra_irq_info gpio_ra_irq_info_##idx[] = { \
420-
DT_INST_FOREACH_PROP_ELEM(idx, interrupt_names, GPIO_RA_IRQ_INFO)}; \
422+
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, interrupt_names), \
423+
(DT_INST_FOREACH_PROP_ELEM(idx, interrupt_names, GPIO_RA_IRQ_INFO)), ())}; \
421424
static struct gpio_ra_config gpio_ra_config_##idx = { \
422425
.common = { \
423426
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(idx), \

0 commit comments

Comments
 (0)