Skip to content

Commit

Permalink
drivers: gpio: dw: Address warning of unused gpio_dw_isr
Browse files Browse the repository at this point in the history
This commit conditionally masks out `gpio_dw_isr` to prevent a build
warning if none of the instances of this driver are connected to an IRQ.

Signed-off-by: Chen Xingyu <[email protected]>
  • Loading branch information
xingrz authored and henrikbrixandersen committed Mar 24, 2024
1 parent b72e78f commit 7273f21
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpio/gpio_dw.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ static inline int gpio_dw_manage_callback(const struct device *port,
return gpio_manage_callback(&context->callbacks, callback, set);
}

#if DT_ANY_INST_HAS_PROP_STATUS_OKAY(interrupts)
static void gpio_dw_isr(const struct device *port)
{
struct gpio_dw_runtime *context = port->data;
Expand All @@ -396,6 +397,7 @@ static void gpio_dw_isr(const struct device *port)

gpio_fire_callbacks(&context->callbacks, port, int_status);
}
#endif /* DT_ANY_INST_HAS_PROP_STATUS_OKAY(interrupts) */

static const struct gpio_driver_api api_funcs = {
.pin_configure = gpio_dw_config,
Expand Down

0 comments on commit 7273f21

Please sign in to comment.