From: Alexandre Courbot <acourbot@nvidia.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: <linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<gnurou@gmail.com>, Alexandre Courbot <acourbot@nvidia.com>
Subject: [PATCH 3/5] gpio: make gpiochip_get_desc() gpiolib-private
Date: Tue, 22 Jul 2014 16:17:41 +0900 [thread overview]
Message-ID: <1406013463-19218-4-git-send-email-acourbot@nvidia.com> (raw)
In-Reply-To: <1406013463-19218-1-git-send-email-acourbot@nvidia.com>
As GPIO descriptors are not going to remain unique anymore, having this
function public is not safe. Restrain its use to gpiolib since we have
no user outside of it.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
drivers/gpio/gpiolib-of.c | 2 +-
drivers/gpio/gpiolib.c | 1 -
drivers/gpio/gpiolib.h | 2 ++
include/linux/gpio/driver.h | 3 ---
4 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 3e2fae205bee..7cfdc2278905 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -23,7 +23,7 @@
#include <linux/pinctrl/pinctrl.h>
#include <linux/slab.h>
-struct gpio_desc;
+#include "gpiolib.h"
/* Private data structure for of_gpiochip_find_and_xlate */
struct gg_data {
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index c5509359ba88..38d176e31379 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -82,7 +82,6 @@ struct gpio_desc *gpiochip_get_desc(struct gpio_chip *chip,
return &chip->desc[hwnum];
}
-EXPORT_SYMBOL_GPL(gpiochip_get_desc);
/**
* Convert a GPIO descriptor to the integer namespace.
diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
index 98020c393eb3..acbb9335f08c 100644
--- a/drivers/gpio/gpiolib.h
+++ b/drivers/gpio/gpiolib.h
@@ -51,6 +51,8 @@ void gpiochip_free_own_desc(struct gpio_desc *desc);
struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np,
const char *list_name, int index, enum of_gpio_flags *flags);
+struct gpio_desc *gpiochip_get_desc(struct gpio_chip *chip, u16 hwnum);
+
extern struct spinlock gpio_lock;
extern struct list_head gpio_chips;
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 573e4f3243d0..4dc79714c136 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -151,9 +151,6 @@ void gpiod_unlock_as_irq(struct gpio_desc *desc);
struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc);
-struct gpio_desc *gpiochip_get_desc(struct gpio_chip *chip,
- u16 hwnum);
-
enum gpio_lookup_flags {
GPIO_ACTIVE_HIGH = (0 << 0),
GPIO_ACTIVE_LOW = (1 << 0),
--
2.0.1
next prev parent reply other threads:[~2014-07-22 7:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 7:17 [PATCH 0/5] gpio: a few cleanup patches Alexandre Courbot
2014-07-22 7:17 ` [PATCH 1/5] gpio: remove export of private of_get_named_gpio_flags() Alexandre Courbot
2014-07-23 15:36 ` Linus Walleij
2014-07-22 7:17 ` [PATCH 2/5] gpio: simplify gpiochip_export() Alexandre Courbot
2014-07-23 15:38 ` Linus Walleij
2014-07-22 7:17 ` Alexandre Courbot [this message]
2014-07-22 20:17 ` [PATCH 3/5] gpio: make gpiochip_get_desc() gpiolib-private Guenter Roeck
2014-07-23 3:10 ` Alexandre Courbot
2014-07-23 3:47 ` Guenter Roeck
2014-07-23 5:39 ` Alexandre Courbot
2014-07-23 6:21 ` Guenter Roeck
2014-07-23 14:48 ` Alexandre Courbot
2014-07-23 15:41 ` Linus Walleij
2014-07-22 7:17 ` [PATCH 4/5] gpio: remove gpiod_lock/unlock_as_irq() Alexandre Courbot
2014-07-23 15:45 ` Linus Walleij
2014-07-22 7:17 ` [PATCH 5/5] gpio: move gpio_ensure_requested() into legacy C file Alexandre Courbot
2014-07-22 8:30 ` Varka Bhadram
2014-07-23 15:48 ` Linus Walleij
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=1406013463-19218-4-git-send-email-acourbot@nvidia.com \
--to=acourbot@nvidia.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).