diff mbox series

[v1,03/13] gpio: dwapb: set default handler to be handle_bad_irq()

Message ID 20200409141228.49561-4-andriy.shevchenko@linux.intel.com
State New
Headers show
Series None | expand

Commit Message

Andy Shevchenko April 9, 2020, 2:12 p.m. UTC
We switch the default handler to be handle_bad_irq() instead of
handle_level_irq(), though for now apply it later in the code,
to make the difference between IRQ chips more visible.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-dwapb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Serge Semin April 15, 2020, 12:22 p.m. UTC | #1
On Thu, Apr 09, 2020 at 05:12:18PM +0300, Andy Shevchenko wrote:
> We switch the default handler to be handle_bad_irq() instead of
> handle_level_irq(), though for now apply it later in the code,
> to make the difference between IRQ chips more visible.

s/IRQ chips/IRQ types ?

Reviewed-by: Serge Semin <fancer.lancer@gmail.com>

Note though I'd better refactored the whole dwapb_configure_irqs()
method with using GPIOlib irqchip API, which is preferred by the current
GPIO subsystem. This isn't a subject for this series. Just to note, that
such change is very actual.

-Sergey

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpio-dwapb.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
> index f61139f787d9..588d5c61ae42 100644
> --- a/drivers/gpio/gpio-dwapb.c
> +++ b/drivers/gpio/gpio-dwapb.c
> @@ -400,7 +400,7 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio,
>  		return;
>  
>  	err = irq_alloc_domain_generic_chips(gpio->domain, ngpio, 2,
> -					     DWAPB_DRIVER_NAME, handle_level_irq,
> +					     DWAPB_DRIVER_NAME, handle_bad_irq,
>  					     IRQ_NOREQUEST, 0,
>  					     IRQ_GC_INIT_NESTED_LOCK);
>  	if (err) {
> @@ -439,6 +439,7 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio,
>  	}
>  
>  	irq_gc->chip_types[0].type = IRQ_TYPE_LEVEL_MASK;
> +	irq_gc->chip_types[0].handler = handle_level_irq;
>  	irq_gc->chip_types[1].type = IRQ_TYPE_EDGE_BOTH;
>  	irq_gc->chip_types[1].handler = handle_edge_irq;
>  
> -- 
> 2.25.1
>
Andy Shevchenko April 15, 2020, 12:33 p.m. UTC | #2
On Wed, Apr 15, 2020 at 03:22:08PM +0300, Serge Semin wrote:
> On Thu, Apr 09, 2020 at 05:12:18PM +0300, Andy Shevchenko wrote:
> > We switch the default handler to be handle_bad_irq() instead of
> > handle_level_irq(), though for now apply it later in the code,
> > to make the difference between IRQ chips more visible.
> 
> s/IRQ chips/IRQ types ?

Actually IRQ chips. The code instantiates two IRQ chips.

> Reviewed-by: Serge Semin <fancer.lancer@gmail.com>

Thanks!

> Note though I'd better refactored the whole dwapb_configure_irqs()
> method with using GPIOlib irqchip API, which is preferred by the current
> GPIO subsystem. This isn't a subject for this series. Just to note, that
> such change is very actual.

I know, but it's indeed out of scope of this series.
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index f61139f787d9..588d5c61ae42 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -400,7 +400,7 @@  static void dwapb_configure_irqs(struct dwapb_gpio *gpio,
 		return;
 
 	err = irq_alloc_domain_generic_chips(gpio->domain, ngpio, 2,
-					     DWAPB_DRIVER_NAME, handle_level_irq,
+					     DWAPB_DRIVER_NAME, handle_bad_irq,
 					     IRQ_NOREQUEST, 0,
 					     IRQ_GC_INIT_NESTED_LOCK);
 	if (err) {
@@ -439,6 +439,7 @@  static void dwapb_configure_irqs(struct dwapb_gpio *gpio,
 	}
 
 	irq_gc->chip_types[0].type = IRQ_TYPE_LEVEL_MASK;
+	irq_gc->chip_types[0].handler = handle_level_irq;
 	irq_gc->chip_types[1].type = IRQ_TYPE_EDGE_BOTH;
 	irq_gc->chip_types[1].handler = handle_edge_irq;