Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1359569 > unrolled thread

[PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded

Started byAxel Lin <axel.lin@ingics.com>
First post2016-03-17 05:10 +0100
Last post2016-03-31 10:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead  of open coded Axel Lin <axel.lin@ingics.com> - 2016-03-17 05:10 +0100
    Re: [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common  instead of open coded Marc Zyngier <marc.zyngier@arm.com> - 2016-03-17 11:10 +0100
    Re: [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common  instead of open coded Linus Walleij <linus.walleij@linaro.org> - 2016-03-31 10:30 +0200

#1359569 — [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded

FromAxel Lin <axel.lin@ingics.com>
Date2016-03-17 05:10 +0100
Subject[PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded
Message-ID<rdxq2-2bN-13@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1359696 — Re: [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded

FromMarc Zyngier <marc.zyngier@arm.com>
Date2016-03-17 11:10 +0100
SubjectRe: [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded
Message-ID<rdD2r-626-23@gated-at.bofh.it>
In reply to#1359569
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...

[toc] | [prev] | [next] | [standalone]


#1367968 — Re: [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded

FromLinus Walleij <linus.walleij@linaro.org>
Date2016-03-31 10:30 +0200
SubjectRe: [PATCH 2/2] gpio: xgene-sb: Use irq_domain_free_irqs_common instead of open coded
Message-ID<riG9l-29W-31@gated-at.bofh.it>
In reply to#1359569
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web