* [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call
[not found] <455637086-2794174-1-git-send-email-arnd@arndb.de>
@ 2016-02-16 15:40 ` Arnd Bergmann
2016-02-16 15:40 ` [PATCH v2 2/5] gpio: remove broken irq_to_gpio() interface Arnd Bergmann
` (5 more replies)
0 siblings, 6 replies; 12+ messages in thread
From: Arnd Bergmann @ 2016-02-16 15:40 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-arm-kernel, Arnd Bergmann, Russell King, Bjorn Helgaas,
Alexandre Courbot, linux-gpio, linux-kernel, Lars-Peter Clausen,
Ralf Baechle, linux-mips, # v4 . 3+, Alban Bedel, Thomas Gleixner,
Paul Burton
gpiolib has removed the irq_to_gpio() API several years ago,
but the global header still provided a non-working stub.
With a MIPS-wide change to use the generic header file, the jz4740
platform is now using the wrong stub implementation of irq_to_gpio(),
which cannot work.
This uses an open-coded implementation in the only line it
is used in.
Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: <stable@vger.kernel.org> # v4.3+
Fixes: 832f5dacfa0b ("MIPS: Remove all the uses of custom gpio.h").
---
arch/mips/jz4740/gpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/jz4740/gpio.c b/arch/mips/jz4740/gpio.c
index 8c6d76c9b2d6..d9907e57e9b9 100644
--- a/arch/mips/jz4740/gpio.c
+++ b/arch/mips/jz4740/gpio.c
@@ -270,7 +270,7 @@ uint32_t jz_gpio_port_get_value(int port, uint32_t mask)
}
EXPORT_SYMBOL(jz_gpio_port_get_value);
-#define IRQ_TO_BIT(irq) BIT(irq_to_gpio(irq) & 0x1f)
+#define IRQ_TO_BIT(irq) BIT((irq - JZ4740_IRQ_GPIO(0)) & 0x1f)
static void jz_gpio_check_trigger_both(struct jz_gpio_chip *chip, unsigned int irq)
{
--
2.7.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 2/5] gpio: remove broken irq_to_gpio() interface
2016-02-16 15:40 ` [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call Arnd Bergmann
@ 2016-02-16 15:40 ` Arnd Bergmann
2016-02-18 23:19 ` Linus Walleij
2016-02-16 15:40 ` [PATCH v2 3/5] gpio: ks8695: remove irq_to_gpio function Arnd Bergmann
` (4 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Arnd Bergmann @ 2016-02-16 15:40 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-arm-kernel, Arnd Bergmann, Russell King, Bjorn Helgaas,
Alexandre Courbot, linux-gpio, linux-kernel, Lars-Peter Clausen,
Ralf Baechle, linux-mips
gpiolib has removed the irq_to_gpio() API several years ago,
but the global header still provided a non-working stub.
To prevent new users of this broken function from showing
up, let's remove the stubs as well.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/linux/gpio.h | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index d12b5d566e4b..6fc1c9e74854 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -70,11 +70,6 @@ static inline int gpio_to_irq(unsigned int gpio)
return __gpio_to_irq(gpio);
}
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
#endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */
/* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */
@@ -222,13 +217,6 @@ static inline void gpiochip_unlock_as_irq(struct gpio_chip *chip,
WARN_ON(1);
}
-static inline int irq_to_gpio(unsigned irq)
-{
- /* irq can never have been returned from gpio_to_irq() */
- WARN_ON(1);
- return -EINVAL;
-}
-
static inline int
gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
unsigned int gpio_offset, unsigned int pin_offset,
--
2.7.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 3/5] gpio: ks8695: remove irq_to_gpio function
2016-02-16 15:40 ` [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call Arnd Bergmann
2016-02-16 15:40 ` [PATCH v2 2/5] gpio: remove broken irq_to_gpio() interface Arnd Bergmann
@ 2016-02-16 15:40 ` Arnd Bergmann
2016-02-18 23:20 ` Linus Walleij
2016-02-16 15:40 ` [PATCH v2 4/5] gpio: ep93xx: remove private " Arnd Bergmann
` (3 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Arnd Bergmann @ 2016-02-16 15:40 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-arm-kernel, Arnd Bergmann, Russell King, Bjorn Helgaas,
Alexandre Courbot, linux-gpio, linux-kernel, Lars-Peter Clausen,
Ralf Baechle, linux-mips
The ks8695 gpio driver has its own copy of the irq_to_gpio()
function. This is completely unused in the mainline kernel
after we converted all remaining users several years ago,
so we can remove the definition as well.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpio/gpio-ks8695.c | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/drivers/gpio/gpio-ks8695.c b/drivers/gpio/gpio-ks8695.c
index 9f86ed9c753b..179723d02f55 100644
--- a/drivers/gpio/gpio-ks8695.c
+++ b/drivers/gpio/gpio-ks8695.c
@@ -205,18 +205,6 @@ static int ks8695_gpio_to_irq(struct gpio_chip *gc, unsigned int pin)
return gpio_irq[pin];
}
-/*
- * Map IRQ number to GPIO line.
- */
-int irq_to_gpio(unsigned int irq)
-{
- if ((irq < KS8695_IRQ_EXTERN0) || (irq > KS8695_IRQ_EXTERN3))
- return -EINVAL;
-
- return (irq - KS8695_IRQ_EXTERN0);
-}
-EXPORT_SYMBOL(irq_to_gpio);
-
/* GPIOLIB interface */
static struct gpio_chip ks8695_gpio_chip = {
--
2.7.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 4/5] gpio: ep93xx: remove private irq_to_gpio function
2016-02-16 15:40 ` [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call Arnd Bergmann
2016-02-16 15:40 ` [PATCH v2 2/5] gpio: remove broken irq_to_gpio() interface Arnd Bergmann
2016-02-16 15:40 ` [PATCH v2 3/5] gpio: ks8695: remove irq_to_gpio function Arnd Bergmann
@ 2016-02-16 15:40 ` Arnd Bergmann
2016-02-18 23:21 ` Linus Walleij
2016-02-16 15:40 ` [PATCH v2 5/5] gpio: allow setting ARCH_NR_GPIOS from Kconfig Arnd Bergmann
` (2 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Arnd Bergmann @ 2016-02-16 15:40 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-arm-kernel, Arnd Bergmann, Russell King, Bjorn Helgaas,
Alexandre Courbot, linux-gpio, linux-kernel, Lars-Peter Clausen,
Ralf Baechle, linux-mips
The ep93xx goes through its own back-and-forth dance every time
it wants to know the gpio number for an irq line, when it really
just hardcodes a fixed offset in ep93xx_gpio_to_irq().
This removes the pointless macro and replaces the conversion inside
of the driver with simple add/subtract operations, using an
explicit macro.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpio/gpio-ep93xx.c | 37 +++++++++++++++++--------------------
1 file changed, 17 insertions(+), 20 deletions(-)
diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
index 20e5846bda28..cd83d30e8ff7 100644
--- a/drivers/gpio/gpio-ep93xx.c
+++ b/drivers/gpio/gpio-ep93xx.c
@@ -18,12 +18,8 @@
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/slab.h>
-#include <linux/gpio/driver.h>
-/* FIXME: this is here for gpio_to_irq() - get rid of this! */
#include <linux/gpio.h>
-#define irq_to_gpio(irq) ((irq) - gpio_to_irq(0))
-
void __iomem *ep93xx_gpio_base; /* FIXME: put this into irq_data */
#define EP93XX_GPIO_REG(x) (ep93xx_gpio_base + (x))
@@ -35,6 +31,7 @@ void __iomem *ep93xx_gpio_base; /* FIXME: put this into irq_data */
#define EP93XX_GPIO_LINE_MAX 63
/* maximum value for irq capable line identifiers */
+#define EP93XX_GPIO_IRQ_BASE 64
#define EP93XX_GPIO_LINE_MAX_IRQ 23
@@ -77,7 +74,7 @@ static void ep93xx_gpio_update_int_params(unsigned port)
static void ep93xx_gpio_int_debounce(unsigned int irq, bool enable)
{
- int line = irq_to_gpio(irq);
+ int line = irq - EP93XX_GPIO_IRQ_BASE;
int port = line >> 3;
int port_mask = 1 << (line & 7);
@@ -98,7 +95,7 @@ static void ep93xx_gpio_ab_irq_handler(struct irq_desc *desc)
status = readb(EP93XX_GPIO_A_INT_STATUS);
for (i = 0; i < 8; i++) {
if (status & (1 << i)) {
- int gpio_irq = gpio_to_irq(0) + i;
+ int gpio_irq = EP93XX_GPIO_IRQ_BASE + i;
generic_handle_irq(gpio_irq);
}
}
@@ -106,7 +103,7 @@ static void ep93xx_gpio_ab_irq_handler(struct irq_desc *desc)
status = readb(EP93XX_GPIO_B_INT_STATUS);
for (i = 0; i < 8; i++) {
if (status & (1 << i)) {
- int gpio_irq = gpio_to_irq(8) + i;
+ int gpio_irq = EP93XX_GPIO_IRQ_BASE + 8 + i;
generic_handle_irq(gpio_irq);
}
}
@@ -121,14 +118,14 @@ static void ep93xx_gpio_f_irq_handler(struct irq_desc *desc)
*/
unsigned int irq = irq_desc_get_irq(desc);
int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */
- int gpio_irq = gpio_to_irq(16) + port_f_idx;
+ int gpio_irq = EP93XX_GPIO_IRQ_BASE + 16 + port_f_idx;
generic_handle_irq(gpio_irq);
}
static void ep93xx_gpio_irq_ack(struct irq_data *d)
{
- int line = irq_to_gpio(d->irq);
+ int line = d->irq - EP93XX_GPIO_IRQ_BASE;
int port = line >> 3;
int port_mask = 1 << (line & 7);
@@ -142,7 +139,7 @@ static void ep93xx_gpio_irq_ack(struct irq_data *d)
static void ep93xx_gpio_irq_mask_ack(struct irq_data *d)
{
- int line = irq_to_gpio(d->irq);
+ int line = d->irq - EP93XX_GPIO_IRQ_BASE;
int port = line >> 3;
int port_mask = 1 << (line & 7);
@@ -157,7 +154,7 @@ static void ep93xx_gpio_irq_mask_ack(struct irq_data *d)
static void ep93xx_gpio_irq_mask(struct irq_data *d)
{
- int line = irq_to_gpio(d->irq);
+ int line = d->irq - EP93XX_GPIO_IRQ_BASE;
int port = line >> 3;
gpio_int_unmasked[port] &= ~(1 << (line & 7));
@@ -166,7 +163,7 @@ static void ep93xx_gpio_irq_mask(struct irq_data *d)
static void ep93xx_gpio_irq_unmask(struct irq_data *d)
{
- int line = irq_to_gpio(d->irq);
+ int line = d->irq - EP93XX_GPIO_IRQ_BASE;
int port = line >> 3;
gpio_int_unmasked[port] |= 1 << (line & 7);
@@ -180,7 +177,7 @@ static void ep93xx_gpio_irq_unmask(struct irq_data *d)
*/
static int ep93xx_gpio_irq_type(struct irq_data *d, unsigned int type)
{
- const int gpio = irq_to_gpio(d->irq);
+ const int gpio = d->irq - EP93XX_GPIO_IRQ_BASE;
const int port = gpio >> 3;
const int port_mask = 1 << (gpio & 7);
irq_flow_handler_t handler;
@@ -241,14 +238,14 @@ static struct irq_chip ep93xx_gpio_irq_chip = {
static void ep93xx_gpio_init_irq(struct platform_device *pdev)
{
- int gpio_irq;
+ int gpio;
int i;
- for (gpio_irq = gpio_to_irq(0);
- gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) {
- irq_set_chip_and_handler(gpio_irq, &ep93xx_gpio_irq_chip,
+ for (gpio = 0; gpio <= EP93XX_GPIO_LINE_MAX_IRQ; ++gpio) {
+ irq_set_chip_and_handler(EP93XX_GPIO_IRQ_BASE + gpio,
+ &ep93xx_gpio_irq_chip,
handle_level_irq);
- irq_clear_status_flags(gpio_irq, IRQ_NOREQUEST);
+ irq_clear_status_flags(EP93XX_GPIO_IRQ_BASE + gpio, IRQ_NOREQUEST);
}
irq_set_chained_handler(platform_get_irq(pdev, 0),
@@ -294,7 +291,7 @@ static int ep93xx_gpio_set_debounce(struct gpio_chip *chip,
unsigned offset, unsigned debounce)
{
int gpio = chip->base + offset;
- int irq = gpio_to_irq(gpio);
+ int irq = EP93XX_GPIO_IRQ_BASE + gpio;
if (irq < 0)
return -EINVAL;
@@ -316,7 +313,7 @@ static int ep93xx_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
if (gpio > EP93XX_GPIO_LINE_MAX_IRQ)
return -EINVAL;
- return 64 + gpio;
+ return EP93XX_GPIO_IRQ_BASE + gpio;
}
static int ep93xx_gpio_add_bank(struct gpio_chip *gc, struct device *dev,
--
2.7.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 5/5] gpio: allow setting ARCH_NR_GPIOS from Kconfig
2016-02-16 15:40 ` [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call Arnd Bergmann
` (2 preceding siblings ...)
2016-02-16 15:40 ` [PATCH v2 4/5] gpio: ep93xx: remove private " Arnd Bergmann
@ 2016-02-16 15:40 ` Arnd Bergmann
2016-02-18 23:23 ` Linus Walleij
2016-02-16 15:47 ` [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call Lars-Peter Clausen
2016-02-16 16:06 ` Ralf Baechle
5 siblings, 1 reply; 12+ messages in thread
From: Arnd Bergmann @ 2016-02-16 15:40 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-arm-kernel, Arnd Bergmann, Russell King, Bjorn Helgaas,
Alexandre Courbot, linux-gpio, linux-kernel, Lars-Peter Clausen,
Ralf Baechle, linux-mips, linux-arch
The ARM version of asm/gpio.h basically just contains the same definitions
as the gpiolib version, with the exception of ARCH_NR_GPIOS.
This adds the option for overriding the constant through Kconfig to
the architecture-independent header, so we can remove the ARM specific
file later.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/asm-generic/gpio.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 40ec1433f05d..8ca627dcea11 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -26,8 +26,12 @@
*/
#ifndef ARCH_NR_GPIOS
+#if defined(CONFIG_ARCH_NR_GPIO) && CONFIG_ARCH_NR_GPIO > 0
+#define ARCH_NR_GPIOS CONFIG_ARCH_NR_GPIO
+#else
#define ARCH_NR_GPIOS 512
#endif
+#endif
/*
* "valid" GPIO numbers are nonnegative and may be passed to
--
2.7.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call
2016-02-16 15:40 ` [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call Arnd Bergmann
` (3 preceding siblings ...)
2016-02-16 15:40 ` [PATCH v2 5/5] gpio: allow setting ARCH_NR_GPIOS from Kconfig Arnd Bergmann
@ 2016-02-16 15:47 ` Lars-Peter Clausen
2016-02-16 16:06 ` Ralf Baechle
5 siblings, 0 replies; 12+ messages in thread
From: Lars-Peter Clausen @ 2016-02-16 15:47 UTC (permalink / raw)
To: Arnd Bergmann, Linus Walleij
Cc: linux-arm-kernel, Russell King, Bjorn Helgaas, Alexandre Courbot,
linux-gpio, linux-kernel, Ralf Baechle, linux-mips, # v4 . 3+,
Alban Bedel, Thomas Gleixner, Paul Burton
On 02/16/2016 04:40 PM, Arnd Bergmann wrote:
> gpiolib has removed the irq_to_gpio() API several years ago,
> but the global header still provided a non-working stub.
>
> With a MIPS-wide change to use the generic header file, the jz4740
> platform is now using the wrong stub implementation of irq_to_gpio(),
> which cannot work.
>
> This uses an open-coded implementation in the only line it
> is used in.
>
> Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: <stable@vger.kernel.org> # v4.3+
> Fixes: 832f5dacfa0b ("MIPS: Remove all the uses of custom gpio.h").
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Thanks.
> ---
> arch/mips/jz4740/gpio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/jz4740/gpio.c b/arch/mips/jz4740/gpio.c
> index 8c6d76c9b2d6..d9907e57e9b9 100644
> --- a/arch/mips/jz4740/gpio.c
> +++ b/arch/mips/jz4740/gpio.c
> @@ -270,7 +270,7 @@ uint32_t jz_gpio_port_get_value(int port, uint32_t mask)
> }
> EXPORT_SYMBOL(jz_gpio_port_get_value);
>
> -#define IRQ_TO_BIT(irq) BIT(irq_to_gpio(irq) & 0x1f)
> +#define IRQ_TO_BIT(irq) BIT((irq - JZ4740_IRQ_GPIO(0)) & 0x1f)
>
> static void jz_gpio_check_trigger_both(struct jz_gpio_chip *chip, unsigned int irq)
> {
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call
2016-02-16 15:40 ` [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call Arnd Bergmann
` (4 preceding siblings ...)
2016-02-16 15:47 ` [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call Lars-Peter Clausen
@ 2016-02-16 16:06 ` Ralf Baechle
2016-02-18 23:19 ` Linus Walleij
5 siblings, 1 reply; 12+ messages in thread
From: Ralf Baechle @ 2016-02-16 16:06 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Linus Walleij, linux-arm-kernel, Russell King, Bjorn Helgaas,
Alexandre Courbot, linux-gpio, linux-kernel, Lars-Peter Clausen,
linux-mips, # v4 . 3+, Alban Bedel, Thomas Gleixner, Paul Burton
On Tue, Feb 16, 2016 at 04:40:34PM +0100, Arnd Bergmann wrote:
> Date: Tue, 16 Feb 2016 16:40:34 +0100
> From: Arnd Bergmann <arnd@arndb.de>
> To: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann <arnd@arndb.de>,
> Russell King <rmk+kernel@arm.linux.org.uk>, Bjorn Helgaas
> <bhelgaas@google.com>, Alexandre Courbot <gnurou@gmail.com>,
> linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter
> Clausen <lars@metafoo.de>, Ralf Baechle <ralf@linux-mips.org>,
> linux-mips@linux-mips.org, "# v4 . 3+" <stable@vger.kernel.org>, Alban
> Bedel <albeu@free.fr>, Thomas Gleixner <tglx@linutronix.de>, Paul Burton
> <paul.burton@imgtec.com>
> Subject: [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call
>
> gpiolib has removed the irq_to_gpio() API several years ago,
> but the global header still provided a non-working stub.
>
> With a MIPS-wide change to use the generic header file, the jz4740
> platform is now using the wrong stub implementation of irq_to_gpio(),
> which cannot work.
>
> This uses an open-coded implementation in the only line it
> is used in.
>
> Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: <stable@vger.kernel.org> # v4.3+
> Fixes: 832f5dacfa0b ("MIPS: Remove all the uses of custom gpio.h").
> ---
> arch/mips/jz4740/gpio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/jz4740/gpio.c b/arch/mips/jz4740/gpio.c
> index 8c6d76c9b2d6..d9907e57e9b9 100644
> --- a/arch/mips/jz4740/gpio.c
> +++ b/arch/mips/jz4740/gpio.c
> @@ -270,7 +270,7 @@ uint32_t jz_gpio_port_get_value(int port, uint32_t mask)
> }
> EXPORT_SYMBOL(jz_gpio_port_get_value);
>
> -#define IRQ_TO_BIT(irq) BIT(irq_to_gpio(irq) & 0x1f)
> +#define IRQ_TO_BIT(irq) BIT((irq - JZ4740_IRQ_GPIO(0)) & 0x1f)
>
> static void jz_gpio_check_trigger_both(struct jz_gpio_chip *chip, unsigned int irq)
> {
I've already committed an identical fix locally.
Ralf
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call
2016-02-16 16:06 ` Ralf Baechle
@ 2016-02-18 23:19 ` Linus Walleij
0 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2016-02-18 23:19 UTC (permalink / raw)
To: Ralf Baechle
Cc: Arnd Bergmann, linux-arm-kernel@lists.infradead.org, Russell King,
Bjorn Helgaas, Alexandre Courbot, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org, Lars-Peter Clausen, Linux MIPS,
# v4 . 3+, Alban Bedel, Thomas Gleixner, Paul Burton
On Tue, Feb 16, 2016 at 5:06 PM, Ralf Baechle <ralf@linux-mips.org> wrote:
>> -#define IRQ_TO_BIT(irq) BIT(irq_to_gpio(irq) & 0x1f)
>> +#define IRQ_TO_BIT(irq) BIT((irq - JZ4740_IRQ_GPIO(0)) & 0x1f)
>>
>> static void jz_gpio_check_trigger_both(struct jz_gpio_chip *chip, unsigned int irq)
>> {
>
> I've already committed an identical fix locally.
>
> Ralf
I took that fix out of linux-next and applied to the GPIO tree so I can apply
the rest of the patches without build problems. If you keep it
around without changing it, git should cope I guess.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/5] gpio: remove broken irq_to_gpio() interface
2016-02-16 15:40 ` [PATCH v2 2/5] gpio: remove broken irq_to_gpio() interface Arnd Bergmann
@ 2016-02-18 23:19 ` Linus Walleij
0 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2016-02-18 23:19 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-arm-kernel@lists.infradead.org, Russell King, Bjorn Helgaas,
Alexandre Courbot, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org, Lars-Peter Clausen, Ralf Baechle,
Linux MIPS
On Tue, Feb 16, 2016 at 4:40 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> gpiolib has removed the irq_to_gpio() API several years ago,
> but the global header still provided a non-working stub.
>
> To prevent new users of this broken function from showing
> up, let's remove the stubs as well.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 3/5] gpio: ks8695: remove irq_to_gpio function
2016-02-16 15:40 ` [PATCH v2 3/5] gpio: ks8695: remove irq_to_gpio function Arnd Bergmann
@ 2016-02-18 23:20 ` Linus Walleij
0 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2016-02-18 23:20 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-arm-kernel@lists.infradead.org, Russell King, Bjorn Helgaas,
Alexandre Courbot, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org, Lars-Peter Clausen, Ralf Baechle,
Linux MIPS
On Tue, Feb 16, 2016 at 4:40 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> The ks8695 gpio driver has its own copy of the irq_to_gpio()
> function. This is completely unused in the mainline kernel
> after we converted all remaining users several years ago,
> so we can remove the definition as well.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 4/5] gpio: ep93xx: remove private irq_to_gpio function
2016-02-16 15:40 ` [PATCH v2 4/5] gpio: ep93xx: remove private " Arnd Bergmann
@ 2016-02-18 23:21 ` Linus Walleij
0 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2016-02-18 23:21 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-arm-kernel@lists.infradead.org, Russell King, Bjorn Helgaas,
Alexandre Courbot, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org, Lars-Peter Clausen, Ralf Baechle,
Linux MIPS
On Tue, Feb 16, 2016 at 4:40 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> The ep93xx goes through its own back-and-forth dance every time
> it wants to know the gpio number for an irq line, when it really
> just hardcodes a fixed offset in ep93xx_gpio_to_irq().
>
> This removes the pointless macro and replaces the conversion inside
> of the driver with simple add/subtract operations, using an
> explicit macro.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Holding this back waiting for the dependent cleanup to come in.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 5/5] gpio: allow setting ARCH_NR_GPIOS from Kconfig
2016-02-16 15:40 ` [PATCH v2 5/5] gpio: allow setting ARCH_NR_GPIOS from Kconfig Arnd Bergmann
@ 2016-02-18 23:23 ` Linus Walleij
0 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2016-02-18 23:23 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-arm-kernel@lists.infradead.org, Russell King, Bjorn Helgaas,
Alexandre Courbot, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org, Lars-Peter Clausen, Ralf Baechle,
Linux MIPS, linux-arch@vger.kernel.org
On Tue, Feb 16, 2016 at 4:40 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> The ARM version of asm/gpio.h basically just contains the same definitions
> as the gpiolib version, with the exception of ARCH_NR_GPIOS.
>
> This adds the option for overriding the constant through Kconfig to
> the architecture-independent header, so we can remove the ARM specific
> file later.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2016-02-18 23:23 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <455637086-2794174-1-git-send-email-arnd@arndb.de>
2016-02-16 15:40 ` [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call Arnd Bergmann
2016-02-16 15:40 ` [PATCH v2 2/5] gpio: remove broken irq_to_gpio() interface Arnd Bergmann
2016-02-18 23:19 ` Linus Walleij
2016-02-16 15:40 ` [PATCH v2 3/5] gpio: ks8695: remove irq_to_gpio function Arnd Bergmann
2016-02-18 23:20 ` Linus Walleij
2016-02-16 15:40 ` [PATCH v2 4/5] gpio: ep93xx: remove private " Arnd Bergmann
2016-02-18 23:21 ` Linus Walleij
2016-02-16 15:40 ` [PATCH v2 5/5] gpio: allow setting ARCH_NR_GPIOS from Kconfig Arnd Bergmann
2016-02-18 23:23 ` Linus Walleij
2016-02-16 15:47 ` [PATCH v2 1/5] MIPS: jz4740: remove broken irq_to_gpio() call Lars-Peter Clausen
2016-02-16 16:06 ` Ralf Baechle
2016-02-18 23:19 ` 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).