public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl/nomadik: always use the simple irqdomain
@ 2012-10-11 14:36 Linus Walleij
  2012-10-11 15:15 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2012-10-11 14:36 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Linus Walleij, Lee Jones,
	Rob Herring

From: Linus Walleij <linus.walleij@linaro.org>

Since the simple irqdomain will fall back to a linear domain
if the first_irq provided is <= 0, just use this, just make
sure the first_irq is negative in the device tree case.

Cc: Lee Jones <lee.jones@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/pinctrl-nomadik.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
index 992982c..a4a4247 100644
--- a/drivers/pinctrl/pinctrl-nomadik.c
+++ b/drivers/pinctrl/pinctrl-nomadik.c
@@ -1277,6 +1277,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
 	struct clk *clk;
 	int secondary_irq;
 	void __iomem *base;
+	int irq_start = -1;
 	int irq;
 	int ret;
 
@@ -1380,19 +1381,11 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
 
 	platform_set_drvdata(dev, nmk_chip);
 
-	if (np) {
-		/* The DT case will just grab a set of IRQ numbers */
-		nmk_chip->domain = irq_domain_add_linear(np, NMK_GPIO_PER_CHIP,
-				&nmk_gpio_irq_simple_ops, nmk_chip);
-	} else {
-		/* Non-DT legacy mode, use hardwired IRQ numbers */
-		int irq_start;
-
+	if (!np)
 		irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio);
-		nmk_chip->domain = irq_domain_add_simple(NULL,
+	nmk_chip->domain = irq_domain_add_simple(NULL,
 				NMK_GPIO_PER_CHIP, irq_start,
 				&nmk_gpio_irq_simple_ops, nmk_chip);
-	}
 	if (!nmk_chip->domain) {
 		dev_err(&dev->dev, "failed to create irqdomain\n");
 		ret = -ENOSYS;
-- 
1.7.11.3


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

* Re: [PATCH] pinctrl/nomadik: always use the simple irqdomain
  2012-10-11 14:36 [PATCH] pinctrl/nomadik: always use the simple irqdomain Linus Walleij
@ 2012-10-11 15:15 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2012-10-11 15:15 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-kernel, linux-arm-kernel, Stephen Warren, Anmar Oueja,
	Linus Walleij, Rob Herring

> From: Linus Walleij <linus.walleij@linaro.org>
> 
> Since the simple irqdomain will fall back to a linear domain
> if the first_irq provided is <= 0, just use this, just make
> sure the first_irq is negative in the device tree case.
> 
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/pinctrl/pinctrl-nomadik.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
> index 992982c..a4a4247 100644
> --- a/drivers/pinctrl/pinctrl-nomadik.c
> +++ b/drivers/pinctrl/pinctrl-nomadik.c
> @@ -1277,6 +1277,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>  	struct clk *clk;
>  	int secondary_irq;
>  	void __iomem *base;
> +	int irq_start = -1;
>  	int irq;
>  	int ret;
>  
> @@ -1380,19 +1381,11 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>  
>  	platform_set_drvdata(dev, nmk_chip);
>  
> -	if (np) {
> -		/* The DT case will just grab a set of IRQ numbers */
> -		nmk_chip->domain = irq_domain_add_linear(np, NMK_GPIO_PER_CHIP,
> -				&nmk_gpio_irq_simple_ops, nmk_chip);
> -	} else {
> -		/* Non-DT legacy mode, use hardwired IRQ numbers */
> -		int irq_start;
> -
> +	if (!np)
>  		irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio);
> -		nmk_chip->domain = irq_domain_add_simple(NULL,
> +	nmk_chip->domain = irq_domain_add_simple(NULL,
>  				NMK_GPIO_PER_CHIP, irq_start,
>  				&nmk_gpio_irq_simple_ops, nmk_chip);
> -	}
>  	if (!nmk_chip->domain) {
>  		dev_err(&dev->dev, "failed to create irqdomain\n");
>  		ret = -ENOSYS;

Looks good:

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

-- 
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] 2+ messages in thread

end of thread, other threads:[~2012-10-11 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-11 14:36 [PATCH] pinctrl/nomadik: always use the simple irqdomain Linus Walleij
2012-10-11 15:15 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox