All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/4] gpio: tc3589x: get rid of static IRQ base
@ 2014-04-09 11:48 Linus Walleij
  2014-04-17  7:47 ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2014-04-09 11:48 UTC (permalink / raw)
  To: linux-gpio; +Cc: Alexandre Courbot, Linus Walleij, Samuel Ortiz, Lee Jones

The static IRQ base is not used on any platforms with this chip
(only Ux500). Get rid of it forever, and rely on dynamic IRQ
descriptor allocation.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-tc3589x.c | 10 +---------
 include/linux/mfd/tc3589x.h |  1 -
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index 113e50cb1f59..4b0d8ccbe561 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -32,9 +32,6 @@ struct tc3589x_gpio {
 	struct device *dev;
 	struct mutex irq_lock;
 	struct irq_domain *domain;
-
-	int irq_base;
-
 	/* Caches of interrupt control registers for bus_lock */
 	u8 regs[CACHE_NR_REGS][CACHE_NR_BANKS];
 	u8 oldregs[CACHE_NR_REGS][CACHE_NR_BANKS];
@@ -290,8 +287,6 @@ static struct irq_domain_ops tc3589x_irq_ops = {
 static int tc3589x_gpio_irq_init(struct tc3589x_gpio *tc3589x_gpio,
 				struct device_node *np)
 {
-	int base = tc3589x_gpio->irq_base;
-
 	/*
 	 * If this results in a linear domain, irq_create_mapping() will
 	 * take care of allocating IRQ descriptors at runtime. When a base
@@ -299,7 +294,7 @@ static int tc3589x_gpio_irq_init(struct tc3589x_gpio *tc3589x_gpio,
 	 * domain is instantiated.
 	 */
 	tc3589x_gpio->domain = irq_domain_add_simple(np,
-			tc3589x_gpio->chip.ngpio, base, &tc3589x_irq_ops,
+			tc3589x_gpio->chip.ngpio, 0, &tc3589x_irq_ops,
 			tc3589x_gpio);
 	if (!tc3589x_gpio->domain) {
 		dev_err(tc3589x_gpio->dev, "Failed to create irqdomain\n");
@@ -348,9 +343,6 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
 	tc3589x_gpio->chip.of_node = np;
 #endif
 
-	tc3589x_gpio->irq_base = tc3589x->irq_base ?
-		tc3589x->irq_base + TC3589x_INT_GPIO(0) : 0;
-
 	/* Bring the GPIO module out of reset */
 	ret = tc3589x_set_bits(tc3589x, TC3589x_RSTCTRL,
 			       TC3589x_RSTCTRL_GPIRST, 0);
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h
index 6b8e1ff4672b..e6088c2e2092 100644
--- a/include/linux/mfd/tc3589x.h
+++ b/include/linux/mfd/tc3589x.h
@@ -111,7 +111,6 @@ enum tx3589x_block {
 #define TC3589x_INT_PORIRQ	7
 
 #define TC3589x_NR_INTERNAL_IRQS	8
-#define TC3589x_INT_GPIO(x)	(TC3589x_NR_INTERNAL_IRQS + (x))
 
 struct tc3589x {
 	struct mutex lock;
-- 
1.9.0


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

* Re: [PATCH 3/4] gpio: tc3589x: get rid of static IRQ base
  2014-04-09 11:48 [PATCH 3/4] gpio: tc3589x: get rid of static IRQ base Linus Walleij
@ 2014-04-17  7:47 ` Lee Jones
  2014-04-23 12:16   ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2014-04-17  7:47 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, Alexandre Courbot, Samuel Ortiz

> The static IRQ base is not used on any platforms with this chip
> (only Ux500). Get rid of it forever, and rely on dynamic IRQ
> descriptor allocation.
> 
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/gpio/gpio-tc3589x.c | 10 +---------
>  include/linux/mfd/tc3589x.h |  1 -
>  2 files changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
> index 113e50cb1f59..4b0d8ccbe561 100644
> --- a/drivers/gpio/gpio-tc3589x.c
> +++ b/drivers/gpio/gpio-tc3589x.c
> @@ -32,9 +32,6 @@ struct tc3589x_gpio {
>  	struct device *dev;
>  	struct mutex irq_lock;
>  	struct irq_domain *domain;
> -
> -	int irq_base;
> -
>  	/* Caches of interrupt control registers for bus_lock */
>  	u8 regs[CACHE_NR_REGS][CACHE_NR_BANKS];
>  	u8 oldregs[CACHE_NR_REGS][CACHE_NR_BANKS];
> @@ -290,8 +287,6 @@ static struct irq_domain_ops tc3589x_irq_ops = {
>  static int tc3589x_gpio_irq_init(struct tc3589x_gpio *tc3589x_gpio,
>  				struct device_node *np)
>  {
> -	int base = tc3589x_gpio->irq_base;
> -
>  	/*
>  	 * If this results in a linear domain, irq_create_mapping() will
>  	 * take care of allocating IRQ descriptors at runtime. When a base
> @@ -299,7 +294,7 @@ static int tc3589x_gpio_irq_init(struct tc3589x_gpio *tc3589x_gpio,
>  	 * domain is instantiated.
>  	 */
>  	tc3589x_gpio->domain = irq_domain_add_simple(np,
> -			tc3589x_gpio->chip.ngpio, base, &tc3589x_irq_ops,
> +			tc3589x_gpio->chip.ngpio, 0, &tc3589x_irq_ops,
>  			tc3589x_gpio);
>  	if (!tc3589x_gpio->domain) {
>  		dev_err(tc3589x_gpio->dev, "Failed to create irqdomain\n");
> @@ -348,9 +343,6 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
>  	tc3589x_gpio->chip.of_node = np;
>  #endif
>  
> -	tc3589x_gpio->irq_base = tc3589x->irq_base ?
> -		tc3589x->irq_base + TC3589x_INT_GPIO(0) : 0;
> -
>  	/* Bring the GPIO module out of reset */
>  	ret = tc3589x_set_bits(tc3589x, TC3589x_RSTCTRL,
>  			       TC3589x_RSTCTRL_GPIRST, 0);
> diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h
> index 6b8e1ff4672b..e6088c2e2092 100644
> --- a/include/linux/mfd/tc3589x.h
> +++ b/include/linux/mfd/tc3589x.h
> @@ -111,7 +111,6 @@ enum tx3589x_block {
>  #define TC3589x_INT_PORIRQ	7
>  
>  #define TC3589x_NR_INTERNAL_IRQS	8
> -#define TC3589x_INT_GPIO(x)	(TC3589x_NR_INTERNAL_IRQS + (x))
>  
>  struct tc3589x {
>  	struct mutex lock;

Does this actually compile? Does this patch have a dependency?

I see TC3589x_INT_GPIO(x) being used still:

  include/linux/mfd/tc3589x.h:
    #define TC3589x_NR_IRQS                TC3589x_INT_GPIO(TC3589x_NR_GPIOS)
-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 3/4] gpio: tc3589x: get rid of static IRQ base
  2014-04-17  7:47 ` Lee Jones
@ 2014-04-23 12:16   ` Linus Walleij
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2014-04-23 12:16 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-gpio, Alexandre Courbot, Samuel Ortiz

On Thu, Apr 17, 2014 at 9:47 AM, Lee Jones <lee.jones@linaro.org> wrote:

>> The static IRQ base is not used on any platforms with this chip
>> (only Ux500). Get rid of it forever, and rely on dynamic IRQ
>> descriptor allocation.
>>
>> Cc: Samuel Ortiz <sameo@linux.intel.com>
>> Cc: Lee Jones <lee.jones@linaro.org>
>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(...)
> Does this actually compile? Does this patch have a dependency?

It actually does compile and has no direct dependencies.

> I see TC3589x_INT_GPIO(x) being used still:
>
>   include/linux/mfd/tc3589x.h:
>     #define TC3589x_NR_IRQS                TC3589x_INT_GPIO(TC3589x_NR_GPIOS)

It compiles because TC3589x_NR_IRQS is not uses anywhere,
so this macro is never put to the test.

I'll respin with a much bigger deletion rooting out not only the
static IRQ but also the static GPIO numbering.

Yours,
Linus Walleij

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

end of thread, other threads:[~2014-04-23 12:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-09 11:48 [PATCH 3/4] gpio: tc3589x: get rid of static IRQ base Linus Walleij
2014-04-17  7:47 ` Lee Jones
2014-04-23 12:16   ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.