From aa57f29aa4e458150754e4629999c0b403f57dad Mon Sep 17 00:00:00 2001 From: Alexandru M Stan Date: Tue, 16 Sep 2014 14:14:16 -0700 Subject: [PATCH] stm32/gpio: Supress overriding interrupt warning in some cases The warning should only warn if there's an actual danger(in order to give a clue to developers that something might be amiss). Messages like "Overriding SPI1_NSS with SPI1_NSS on EXTI4" are just spammy. This patch makes it so it only warns if the interrupt is different. BUG=chrome-os-partner:31390 TEST=spam gpio_enable_interrupt(GPIO_SPI1_NSS); in a bunch of places (like spi_event), it should not complain about the interrupt being set to the same thing before. Whereas before it was so spammy it did not even have time to reply to SPI. BRANCH=None Change-Id: I786a821eb8167e3568d0be371c4de26bb124431a Signed-off-by: Alexandru M Stan Reviewed-on: https://chromium-review.googlesource.com/218563 Reviewed-by: Randall Spangler --- chip/stm32/gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chip/stm32/gpio.c b/chip/stm32/gpio.c index df65aba533..37dc7adbbb 100644 --- a/chip/stm32/gpio.c +++ b/chip/stm32/gpio.c @@ -79,7 +79,7 @@ int gpio_enable_interrupt(enum gpio_signal signal) bit = 31 - __builtin_clz(g->mask); - if (exti_events[bit]) { + if ((exti_events[bit]) && (exti_events[bit] != g)) { CPRINTS("Overriding %s with %s on EXTI%d", exti_events[bit]->name, g->name, bit); }