* [PATCH 1/4] gpio: remove broken irq_to_gpio() interface [not found] ` <1455551208-2825510-1-git-send-email-arnd@arndb.de> @ 2016-02-15 15:46 ` Arnd Bergmann 2016-02-15 16:01 ` Lars-Peter Clausen 2016-02-16 15:42 ` Linus Walleij 0 siblings, 2 replies; 10+ messages in thread From: Arnd Bergmann @ 2016-02-15 15:46 UTC (permalink / raw) To: Linus Walleij, Alexandre Courbot Cc: linux-arm-kernel, Arnd Bergmann, Russell King, Bjorn Helgaas, linux-gpio, linux-kernel, Ralf Baechle, Paul Burton, linux-mips gpiolib has removed the irq_to_gpio() API several years ago, but the global header still provided a non-working stub. Apparently one new user has shown up in arch/mips, so this patch moves the broken definition to where it is used, ensuring that we get new users but not changing the current behavior on jz4740. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- arch/mips/jz4740/gpio.c | 7 +++++++ include/linux/gpio.h | 12 ------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/arch/mips/jz4740/gpio.c b/arch/mips/jz4740/gpio.c index 8c6d76c9b2d6..e9bb43714892 100644 --- a/arch/mips/jz4740/gpio.c +++ b/arch/mips/jz4740/gpio.c @@ -16,6 +16,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> +#include <linux/compiler.h> #include <linux/io.h> #include <linux/gpio.h> @@ -270,6 +271,12 @@ uint32_t jz_gpio_port_get_value(int port, uint32_t mask) } EXPORT_SYMBOL(jz_gpio_port_get_value); +static inline __deprecated int irq_to_gpio(unsigned int irq) +{ + /* this has clearly not worked for a long time */ + return -EINVAL; +} + #define IRQ_TO_BIT(irq) BIT(irq_to_gpio(irq) & 0x1f) static void jz_gpio_check_trigger_both(struct jz_gpio_chip *chip, unsigned int irq) 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] 10+ messages in thread
* Re: [PATCH 1/4] gpio: remove broken irq_to_gpio() interface 2016-02-15 15:46 ` [PATCH 1/4] gpio: remove broken irq_to_gpio() interface Arnd Bergmann @ 2016-02-15 16:01 ` Lars-Peter Clausen 2016-02-15 20:16 ` Arnd Bergmann 2016-02-16 15:42 ` Linus Walleij 1 sibling, 1 reply; 10+ messages in thread From: Lars-Peter Clausen @ 2016-02-15 16:01 UTC (permalink / raw) To: Arnd Bergmann, Linus Walleij, Alexandre Courbot Cc: linux-arm-kernel, Russell King, Bjorn Helgaas, linux-gpio, linux-kernel, Ralf Baechle, Paul Burton, linux-mips On 02/15/2016 04:46 PM, Arnd Bergmann wrote: > +static inline __deprecated int irq_to_gpio(unsigned int irq) > +{ > + /* this has clearly not worked for a long time */ > + return -EINVAL; > +} > + > #define IRQ_TO_BIT(irq) BIT(irq_to_gpio(irq) & 0x1f) The issue seems to be a fallout from commit 832f5dacfa0b ("MIPS: Remove all the uses of custom gpio.h"). The irq_to_gpio() should be replaced with "(irq - JZ4740_IRQ_GPIO(0))". - Lars ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] gpio: remove broken irq_to_gpio() interface 2016-02-15 16:01 ` Lars-Peter Clausen @ 2016-02-15 20:16 ` Arnd Bergmann 0 siblings, 0 replies; 10+ messages in thread From: Arnd Bergmann @ 2016-02-15 20:16 UTC (permalink / raw) To: Lars-Peter Clausen Cc: Linus Walleij, Alexandre Courbot, linux-arm-kernel, Russell King, Bjorn Helgaas, linux-gpio, linux-kernel, Ralf Baechle, Paul Burton, linux-mips On Monday 15 February 2016 17:01:09 Lars-Peter Clausen wrote: > On 02/15/2016 04:46 PM, Arnd Bergmann wrote: > > +static inline __deprecated int irq_to_gpio(unsigned int irq) > > +{ > > + /* this has clearly not worked for a long time */ > > + return -EINVAL; > > +} > > + > > #define IRQ_TO_BIT(irq) BIT(irq_to_gpio(irq) & 0x1f) > > The issue seems to be a fallout from commit 832f5dacfa0b ("MIPS: Remove all > the uses of custom gpio.h"). > > The irq_to_gpio() should be replaced with "(irq - JZ4740_IRQ_GPIO(0))". > > Ah, that explain it, so it has not been broken for that long. Arnd ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] gpio: remove broken irq_to_gpio() interface 2016-02-15 15:46 ` [PATCH 1/4] gpio: remove broken irq_to_gpio() interface Arnd Bergmann 2016-02-15 16:01 ` Lars-Peter Clausen @ 2016-02-16 15:42 ` Linus Walleij 2016-02-16 15:42 ` Linus Walleij 2016-02-16 15:45 ` Arnd Bergmann 1 sibling, 2 replies; 10+ messages in thread From: Linus Walleij @ 2016-02-16 15:42 UTC (permalink / raw) To: Arnd Bergmann Cc: Alexandre Courbot, linux-arm-kernel@lists.infradead.org, Russell King, Bjorn Helgaas, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Ralf Baechle, Paul Burton, Linux MIPS On Mon, Feb 15, 2016 at 4:46 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. > > Apparently one new user has shown up in arch/mips, so this patch > moves the broken definition to where it is used, ensuring that > we get new users but not changing the current behavior on jz4740. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Patch applied. I expect the driver maintainer to deal with the resulting deprecation fallout. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] gpio: remove broken irq_to_gpio() interface 2016-02-16 15:42 ` Linus Walleij @ 2016-02-16 15:42 ` Linus Walleij 2016-02-16 15:45 ` Arnd Bergmann 1 sibling, 0 replies; 10+ messages in thread From: Linus Walleij @ 2016-02-16 15:42 UTC (permalink / raw) To: Arnd Bergmann Cc: Alexandre Courbot, linux-arm-kernel@lists.infradead.org, Russell King, Bjorn Helgaas, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Ralf Baechle, Paul Burton, Linux MIPS On Mon, Feb 15, 2016 at 4:46 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. > > Apparently one new user has shown up in arch/mips, so this patch > moves the broken definition to where it is used, ensuring that > we get new users but not changing the current behavior on jz4740. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Patch applied. I expect the driver maintainer to deal with the resulting deprecation fallout. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] gpio: remove broken irq_to_gpio() interface 2016-02-16 15:42 ` Linus Walleij 2016-02-16 15:42 ` Linus Walleij @ 2016-02-16 15:45 ` Arnd Bergmann 2016-02-16 15:45 ` Arnd Bergmann 2016-02-16 15:53 ` Linus Walleij 1 sibling, 2 replies; 10+ messages in thread From: Arnd Bergmann @ 2016-02-16 15:45 UTC (permalink / raw) To: Linus Walleij Cc: Alexandre Courbot, linux-arm-kernel@lists.infradead.org, Russell King, Bjorn Helgaas, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Ralf Baechle, Paul Burton, Linux MIPS On Tuesday 16 February 2016 16:42:18 Linus Walleij wrote: > On Mon, Feb 15, 2016 at 4:46 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. > > > > Apparently one new user has shown up in arch/mips, so this patch > > moves the broken definition to where it is used, ensuring that > > we get new users but not changing the current behavior on jz4740. > > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > Patch applied. > > I expect the driver maintainer to deal with the resulting > deprecation fallout. > I've just sent v2 of the series, with a separate patch for MIPS that now conflicts with this one. Can you pick up the new patch instead? Arnd ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] gpio: remove broken irq_to_gpio() interface 2016-02-16 15:45 ` Arnd Bergmann @ 2016-02-16 15:45 ` Arnd Bergmann 2016-02-16 15:53 ` Linus Walleij 1 sibling, 0 replies; 10+ messages in thread From: Arnd Bergmann @ 2016-02-16 15:45 UTC (permalink / raw) To: Linus Walleij Cc: Alexandre Courbot, linux-arm-kernel@lists.infradead.org, Russell King, Bjorn Helgaas, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Ralf Baechle, Paul Burton, Linux MIPS On Tuesday 16 February 2016 16:42:18 Linus Walleij wrote: > On Mon, Feb 15, 2016 at 4:46 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. > > > > Apparently one new user has shown up in arch/mips, so this patch > > moves the broken definition to where it is used, ensuring that > > we get new users but not changing the current behavior on jz4740. > > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > Patch applied. > > I expect the driver maintainer to deal with the resulting > deprecation fallout. > I've just sent v2 of the series, with a separate patch for MIPS that now conflicts with this one. Can you pick up the new patch instead? Arnd ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] gpio: remove broken irq_to_gpio() interface 2016-02-16 15:45 ` Arnd Bergmann 2016-02-16 15:45 ` Arnd Bergmann @ 2016-02-16 15:53 ` Linus Walleij 2016-02-16 15:53 ` Linus Walleij 1 sibling, 1 reply; 10+ messages in thread From: Linus Walleij @ 2016-02-16 15:53 UTC (permalink / raw) To: Arnd Bergmann Cc: Alexandre Courbot, linux-arm-kernel@lists.infradead.org, Russell King, Bjorn Helgaas, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Ralf Baechle, Paul Burton, Linux MIPS On Tue, Feb 16, 2016 at 4:45 PM, Arnd Bergmann <arnd@arndb.de> wrote: > I've just sent v2 of the series, with a separate patch for MIPS > that now conflicts with this one. Can you pick up the new patch > instead? OK I'll back out and apply the v2 versions. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] gpio: remove broken irq_to_gpio() interface 2016-02-16 15:53 ` Linus Walleij @ 2016-02-16 15:53 ` Linus Walleij 0 siblings, 0 replies; 10+ messages in thread From: Linus Walleij @ 2016-02-16 15:53 UTC (permalink / raw) To: Arnd Bergmann Cc: Alexandre Courbot, linux-arm-kernel@lists.infradead.org, Russell King, Bjorn Helgaas, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Ralf Baechle, Paul Burton, Linux MIPS On Tue, Feb 16, 2016 at 4:45 PM, Arnd Bergmann <arnd@arndb.de> wrote: > I've just sent v2 of the series, with a separate patch for MIPS > that now conflicts with this one. Can you pick up the new patch > instead? OK I'll back out and apply the v2 versions. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 0/5] gpio: clean up irq_to_gpio and ARCH_NR_GPIOS [not found] <20160202194831.10827.63244.stgit@bhelgaas-glaptop2.roam.corp.google.com> [not found] ` <1455551208-2825510-1-git-send-email-arnd@arndb.de> @ 2016-02-16 15:37 ` Arnd Bergmann 1 sibling, 0 replies; 10+ messages in thread From: Arnd Bergmann @ 2016-02-16 15:37 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 I noticed that arch/arm/include/asm/gpio.h can almost be removed, after we have already removed the file for most other architectures now. When I removed it, I ran into problems with irq_to_gpio(), which we had already killed off in ARM, but it survived (barely) in the global headers and accidentally gained an invalid user This kills it off some more. The first patch should go as a bugfix into the MIPS tree, the other ones should only get merged later, but I think that's fine if they get submitted for 4.6. I left them as a series of five patches to clarify the build-time dependency. Merging patch 2 before 1 turns the MIPS runtime error into a compiletime error. changes in v2: * the MIPS change should now correctly fix the bug, thanks to Lars-Peter. * I left out the ARM specific change for now, and just adapted the generic file so we don't need that any more. * Fixed the bug that Russell pointed out Arnd ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2016-02-16 15:53 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20160202194831.10827.63244.stgit@bhelgaas-glaptop2.roam.corp.google.com>
[not found] ` <1455551208-2825510-1-git-send-email-arnd@arndb.de>
2016-02-15 15:46 ` [PATCH 1/4] gpio: remove broken irq_to_gpio() interface Arnd Bergmann
2016-02-15 16:01 ` Lars-Peter Clausen
2016-02-15 20:16 ` Arnd Bergmann
2016-02-16 15:42 ` Linus Walleij
2016-02-16 15:42 ` Linus Walleij
2016-02-16 15:45 ` Arnd Bergmann
2016-02-16 15:45 ` Arnd Bergmann
2016-02-16 15:53 ` Linus Walleij
2016-02-16 15:53 ` Linus Walleij
2016-02-16 15:37 ` [PATCH v2 0/5] gpio: clean up irq_to_gpio and ARCH_NR_GPIOS Arnd Bergmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox