linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] mfd: Simplify IRQ domain registration code in STMPE
@ 2012-11-23 12:56 Lee Jones
  2012-11-23 12:59 ` Viresh Kumar
  2012-12-01 15:56 ` Linus Walleij
  0 siblings, 2 replies; 5+ messages in thread
From: Lee Jones @ 2012-11-23 12:56 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, viresh.kumar, Lee Jones

Historically, a driver would have to decide whether it required
a Linear or Legacy IRQ domain when registering one. This can end
up as quite a lot of code. A new Simple call now exists which
simplifies this process. Let's make use of it here.

Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/stmpe.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index b03cc64..0e6d8b8 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -889,18 +889,14 @@ static struct irq_domain_ops stmpe_irq_ops = {
 static int __devinit stmpe_irq_init(struct stmpe *stmpe,
 				struct device_node *np)
 {
-	int base = stmpe->irq_base;
+	int base = 0;
 	int num_irqs = stmpe->variant->num_irqs;
 
-	if (base) {
-		stmpe->domain = irq_domain_add_legacy(
-			np, num_irqs, base, 0, &stmpe_irq_ops, stmpe);
-	}
-	else {
-		stmpe->domain = irq_domain_add_linear(
-			np, num_irqs, &stmpe_irq_ops, stmpe);
-	}
+	if (!np)
+		base = stmpe->irq_base;
 
+	stmpe->domain = irq_domain_add_simple(np, num_irqs, base,
+					      &stmpe_irq_ops, stmpe);
 	if (!stmpe->domain) {
 		dev_err(stmpe->dev, "Failed to create irqdomain\n");
 		return -ENOSYS;
-- 
1.7.9.5


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

* Re: [PATCH 1/1] mfd: Simplify IRQ domain registration code in STMPE
  2012-11-23 12:56 [PATCH 1/1] mfd: Simplify IRQ domain registration code in STMPE Lee Jones
@ 2012-11-23 12:59 ` Viresh Kumar
  2012-12-01 15:56 ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2012-11-23 12:59 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-arm-kernel, linux-kernel, arnd, linus.walleij

On 23 November 2012 18:26, Lee Jones <lee.jones@linaro.org> wrote:
> Historically, a driver would have to decide whether it required
> a Linear or Legacy IRQ domain when registering one. This can end
> up as quite a lot of code. A new Simple call now exists which
> simplifies this process. Let's make use of it here.
>
> Samuel Ortiz <sameo@linux.intel.com>

Cc: ?

> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>

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

* Re: [PATCH 1/1] mfd: Simplify IRQ domain registration code in STMPE
  2012-11-23 12:56 [PATCH 1/1] mfd: Simplify IRQ domain registration code in STMPE Lee Jones
  2012-11-23 12:59 ` Viresh Kumar
@ 2012-12-01 15:56 ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2012-12-01 15:56 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-arm-kernel, linux-kernel, arnd, linus.walleij, viresh.kumar

On Fri, Nov 23, 2012 at 1:56 PM, Lee Jones <lee.jones@linaro.org> wrote:

> Historically, a driver would have to decide whether it required
> a Linear or Legacy IRQ domain when registering one. This can end
> up as quite a lot of code. A new Simple call now exists which
> simplifies this process. Let's make use of it here.
>
> Samuel Ortiz <sameo@linux.intel.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Should do the trick!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH 1/1] mfd: Simplify IRQ domain registration code in STMPE
  2012-11-23 15:19 Lee Jones
@ 2012-11-30 14:01 ` Lee Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2012-11-30 14:01 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, viresh.kumar, Samuel Ortiz

On Fri, 23 Nov 2012, Lee Jones wrote:

> Historically, a driver would have to decide whether it required
> a Linear or Legacy IRQ domain when registering one. This can end
> up as quite a lot of code. A new Simple call now exists which
> simplifies this process. Let's make use of it here.
> 
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/stmpe.c |   14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
> index b03cc64..0e6d8b8 100644
> --- a/drivers/mfd/stmpe.c
> +++ b/drivers/mfd/stmpe.c
> @@ -889,18 +889,14 @@ static struct irq_domain_ops stmpe_irq_ops = {
>  static int __devinit stmpe_irq_init(struct stmpe *stmpe,
>  				struct device_node *np)
>  {
> -	int base = stmpe->irq_base;
> +	int base = 0;
>  	int num_irqs = stmpe->variant->num_irqs;
>  
> -	if (base) {
> -		stmpe->domain = irq_domain_add_legacy(
> -			np, num_irqs, base, 0, &stmpe_irq_ops, stmpe);
> -	}
> -	else {
> -		stmpe->domain = irq_domain_add_linear(
> -			np, num_irqs, &stmpe_irq_ops, stmpe);
> -	}
> +	if (!np)
> +		base = stmpe->irq_base;
>  
> +	stmpe->domain = irq_domain_add_simple(np, num_irqs, base,
> +					      &stmpe_irq_ops, stmpe);
>  	if (!stmpe->domain) {
>  		dev_err(stmpe->dev, "Failed to create irqdomain\n");
>  		return -ENOSYS;
> -- 
> 1.7.9.5

Poke.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH 1/1] mfd: Simplify IRQ domain registration code in STMPE
@ 2012-11-23 15:19 Lee Jones
  2012-11-30 14:01 ` Lee Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Lee Jones @ 2012-11-23 15:19 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, viresh.kumar, Lee Jones, Samuel Ortiz

Historically, a driver would have to decide whether it required
a Linear or Legacy IRQ domain when registering one. This can end
up as quite a lot of code. A new Simple call now exists which
simplifies this process. Let's make use of it here.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/stmpe.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index b03cc64..0e6d8b8 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -889,18 +889,14 @@ static struct irq_domain_ops stmpe_irq_ops = {
 static int __devinit stmpe_irq_init(struct stmpe *stmpe,
 				struct device_node *np)
 {
-	int base = stmpe->irq_base;
+	int base = 0;
 	int num_irqs = stmpe->variant->num_irqs;
 
-	if (base) {
-		stmpe->domain = irq_domain_add_legacy(
-			np, num_irqs, base, 0, &stmpe_irq_ops, stmpe);
-	}
-	else {
-		stmpe->domain = irq_domain_add_linear(
-			np, num_irqs, &stmpe_irq_ops, stmpe);
-	}
+	if (!np)
+		base = stmpe->irq_base;
 
+	stmpe->domain = irq_domain_add_simple(np, num_irqs, base,
+					      &stmpe_irq_ops, stmpe);
 	if (!stmpe->domain) {
 		dev_err(stmpe->dev, "Failed to create irqdomain\n");
 		return -ENOSYS;
-- 
1.7.9.5


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

end of thread, other threads:[~2012-12-01 15:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-23 12:56 [PATCH 1/1] mfd: Simplify IRQ domain registration code in STMPE Lee Jones
2012-11-23 12:59 ` Viresh Kumar
2012-12-01 15:56 ` Linus Walleij
2012-11-23 15:19 Lee Jones
2012-11-30 14:01 ` Lee Jones

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).