mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>
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>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ralf Baechle <ralf@linux-mips.org>,
	Paul Burton <paul.burton@imgtec.com>,
	linux-mips@linux-mips.org
Subject: [PATCH 1/4] gpio: remove broken irq_to_gpio() interface
Date: Mon, 15 Feb 2016 16:46:28 +0100	[thread overview]
Message-ID: <1455551208-2825510-2-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1455551208-2825510-1-git-send-email-arnd@arndb.de>

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

  reply	other threads:[~2016-02-15 15:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 19:53 [PATCH 0/2] GPIO: Clean up asm/gpio.h Bjorn Helgaas
2016-02-02 19:53 ` [PATCH 1/2] gpio: Include linux/gpio.h instead of asm/gpio.h Bjorn Helgaas
2016-02-03  0:02   ` Alexandre Courbot
2016-02-15 13:35   ` Linus Walleij
2016-02-02 19:53 ` [PATCH 2/2] gpio: Remove unused asm/gpio.h files Bjorn Helgaas
2016-02-03  0:03   ` Alexandre Courbot
2016-02-03  8:19 ` [PATCH 0/2] GPIO: Clean up asm/gpio.h Thomas Gleixner
2016-02-05 13:43 ` Linus Walleij
2016-02-15 15:46 ` [PATCH 0/4] clean up irq_to_gpio and asm/gpio.h Arnd Bergmann
2016-02-15 15:46   ` Arnd Bergmann [this message]
2016-02-15 16:01     ` [PATCH 1/4] gpio: remove broken irq_to_gpio() interface Lars-Peter Clausen
2016-02-15 20:16       ` Arnd Bergmann
2016-02-16 15:42     ` Linus Walleij
2016-02-16 15:45       ` Arnd Bergmann
2016-02-16 15:53         ` Linus Walleij
2016-02-15 15:46   ` [PATCH 2/4] gpio: ks8695: remove irq_to_gpio function Arnd Bergmann
2016-02-16 15:43     ` Linus Walleij
2016-02-15 15:46   ` [PATCH 3/4] gpio: ep93xx: remove private " Arnd Bergmann
2016-02-16 15:51     ` Linus Walleij
2016-02-16 16:12       ` Arnd Bergmann
2016-02-15 15:46   ` [PATCH 4/4] ARM: remove asm/gpio.h Arnd Bergmann
2016-02-15 16:03     ` Russell King - ARM Linux
2016-02-16 15:37 ` [PATCH v2 0/5] gpio: clean up irq_to_gpio and ARCH_NR_GPIOS Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455551208-2825510-2-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=paul.burton@imgtec.com \
    --cc=ralf@linux-mips.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®