linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] irqdomain: Export irq_domain_free_irqs_common
@ 2016-03-17  4:00 Axel Lin
  2016-03-17  4:01 ` [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Axel Lin @ 2016-03-17  4:00 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Y Vo, Alexandre Courbot, Jiang Liu, Marc Zyngier, Thomas Gleixner,
	linux-gpio, linux-kernel

Export irq_domain_free_irqs_common so it can be used by modules.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 kernel/irq/irqdomain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 3a519a0..245a485 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -1099,6 +1099,7 @@ void irq_domain_free_irqs_common(struct irq_domain *domain, unsigned int virq,
 	}
 	irq_domain_free_irqs_parent(domain, virq, nr_irqs);
 }
+EXPORT_SYMBOL_GPL(irq_domain_free_irqs_common);
 
 /**
  * irq_domain_free_irqs_top - Clear handler and handler data, clear irqdata and free parent
-- 
2.1.4




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded
  2016-03-17  4:00 [PATCH 1/2] irqdomain: Export irq_domain_free_irqs_common Axel Lin
@ 2016-03-17  4:01 ` Axel Lin
  2016-03-17 10:07   ` Marc Zyngier
  2016-03-31  8:22   ` Linus Walleij
  2016-03-17  9:48 ` [PATCH 1/2] irqdomain: Export irq_domain_free_irqs_common Thomas Gleixner
  2016-03-31  8:21 ` Linus Walleij
  2 siblings, 2 replies; 6+ messages in thread
From: Axel Lin @ 2016-03-17  4:01 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Y Vo, Alexandre Courbot, Jiang Liu, Marc Zyngier, Thomas Gleixner,
	linux-gpio, linux-kernel

Current code calls irq_domain_alloc_irqs_parent() in .alloc,
so it should call irq_domain_free_irqs_parent() accordingly in .free.
Fix it by switching to use irq_domain_free_irqs_common() instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/gpio/gpio-xgene-sb.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c
index 31cbcb8..0332586 100644
--- a/drivers/gpio/gpio-xgene-sb.c
+++ b/drivers/gpio/gpio-xgene-sb.c
@@ -216,23 +216,10 @@ static int xgene_gpio_sb_domain_alloc(struct irq_domain *domain,
 			&parent_fwspec);
 }
 
-static void xgene_gpio_sb_domain_free(struct irq_domain *domain,
-		unsigned int virq,
-		unsigned int nr_irqs)
-{
-	struct irq_data *d;
-	unsigned int i;
-
-	for (i = 0; i < nr_irqs; i++) {
-		d = irq_domain_get_irq_data(domain, virq + i);
-		irq_domain_reset_irq_data(d);
-	}
-}
-
 static const struct irq_domain_ops xgene_gpio_sb_domain_ops = {
 	.translate      = xgene_gpio_sb_domain_translate,
 	.alloc          = xgene_gpio_sb_domain_alloc,
-	.free           = xgene_gpio_sb_domain_free,
+	.free           = irq_domain_free_irqs_common,
 	.activate	= xgene_gpio_sb_domain_activate,
 	.deactivate	= xgene_gpio_sb_domain_deactivate,
 };
-- 
2.1.4




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] irqdomain: Export irq_domain_free_irqs_common
  2016-03-17  4:00 [PATCH 1/2] irqdomain: Export irq_domain_free_irqs_common Axel Lin
  2016-03-17  4:01 ` [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded Axel Lin
@ 2016-03-17  9:48 ` Thomas Gleixner
  2016-03-31  8:21 ` Linus Walleij
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2016-03-17  9:48 UTC (permalink / raw)
  To: Axel Lin
  Cc: Linus Walleij, Y Vo, Alexandre Courbot, Jiang Liu, Marc Zyngier,
	linux-gpio, linux-kernel

On Thu, 17 Mar 2016, Axel Lin wrote:

> Export irq_domain_free_irqs_common so it can be used by modules.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  kernel/irq/irqdomain.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
> index 3a519a0..245a485 100644
> --- a/kernel/irq/irqdomain.c
> +++ b/kernel/irq/irqdomain.c
> @@ -1099,6 +1099,7 @@ void irq_domain_free_irqs_common(struct irq_domain *domain, unsigned int virq,
>  	}
>  	irq_domain_free_irqs_parent(domain, virq, nr_irqs);
>  }
> +EXPORT_SYMBOL_GPL(irq_domain_free_irqs_common);

Acked-by: Thomas Gleixner <tglx@linutronix.de>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded
  2016-03-17  4:01 ` [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded Axel Lin
@ 2016-03-17 10:07   ` Marc Zyngier
  2016-03-31  8:22   ` Linus Walleij
  1 sibling, 0 replies; 6+ messages in thread
From: Marc Zyngier @ 2016-03-17 10:07 UTC (permalink / raw)
  To: Axel Lin, Linus Walleij
  Cc: Y Vo, Alexandre Courbot, Jiang Liu, Thomas Gleixner, linux-gpio,
	linux-kernel

On 17/03/16 04:01, Axel Lin wrote:
> Current code calls irq_domain_alloc_irqs_parent() in .alloc,
> so it should call irq_domain_free_irqs_parent() accordingly in .free.
> Fix it by switching to use irq_domain_free_irqs_common() instead.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/gpio/gpio-xgene-sb.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c
> index 31cbcb8..0332586 100644
> --- a/drivers/gpio/gpio-xgene-sb.c
> +++ b/drivers/gpio/gpio-xgene-sb.c
> @@ -216,23 +216,10 @@ static int xgene_gpio_sb_domain_alloc(struct irq_domain *domain,
>  			&parent_fwspec);
>  }
>  
> -static void xgene_gpio_sb_domain_free(struct irq_domain *domain,
> -		unsigned int virq,
> -		unsigned int nr_irqs)
> -{
> -	struct irq_data *d;
> -	unsigned int i;
> -
> -	for (i = 0; i < nr_irqs; i++) {
> -		d = irq_domain_get_irq_data(domain, virq + i);
> -		irq_domain_reset_irq_data(d);
> -	}
> -}
> -
>  static const struct irq_domain_ops xgene_gpio_sb_domain_ops = {
>  	.translate      = xgene_gpio_sb_domain_translate,
>  	.alloc          = xgene_gpio_sb_domain_alloc,
> -	.free           = xgene_gpio_sb_domain_free,
> +	.free           = irq_domain_free_irqs_common,
>  	.activate	= xgene_gpio_sb_domain_activate,
>  	.deactivate	= xgene_gpio_sb_domain_deactivate,
>  };
> 

Ah, nice catch. For both patches:

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] irqdomain: Export irq_domain_free_irqs_common
  2016-03-17  4:00 [PATCH 1/2] irqdomain: Export irq_domain_free_irqs_common Axel Lin
  2016-03-17  4:01 ` [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded Axel Lin
  2016-03-17  9:48 ` [PATCH 1/2] irqdomain: Export irq_domain_free_irqs_common Thomas Gleixner
@ 2016-03-31  8:21 ` Linus Walleij
  2 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2016-03-31  8:21 UTC (permalink / raw)
  To: Axel Lin
  Cc: Y Vo, Alexandre Courbot, Jiang Liu, Marc Zyngier, Thomas Gleixner,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org

On Thu, Mar 17, 2016 at 5:00 AM, Axel Lin <axel.lin@ingics.com> wrote:

> Export irq_domain_free_irqs_common so it can be used by modules.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Patch applied to the GPIO tree with TGLX's ACK.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded
  2016-03-17  4:01 ` [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded Axel Lin
  2016-03-17 10:07   ` Marc Zyngier
@ 2016-03-31  8:22   ` Linus Walleij
  1 sibling, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2016-03-31  8:22 UTC (permalink / raw)
  To: Axel Lin
  Cc: Y Vo, Alexandre Courbot, Jiang Liu, Marc Zyngier, Thomas Gleixner,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org

On Thu, Mar 17, 2016 at 5:01 AM, Axel Lin <axel.lin@ingics.com> wrote:

> Current code calls irq_domain_alloc_irqs_parent() in .alloc,
> so it should call irq_domain_free_irqs_parent() accordingly in .free.
> Fix it by switching to use irq_domain_free_irqs_common() instead.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Patch applied with Marc's ACK.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-03-31  8:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-17  4:00 [PATCH 1/2] irqdomain: Export irq_domain_free_irqs_common Axel Lin
2016-03-17  4:01 ` [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded Axel Lin
2016-03-17 10:07   ` Marc Zyngier
2016-03-31  8:22   ` Linus Walleij
2016-03-17  9:48 ` [PATCH 1/2] irqdomain: Export irq_domain_free_irqs_common Thomas Gleixner
2016-03-31  8:21 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).