Skip to content

Commit

Permalink
gpio: make gpiochip_get_desc() gpiolib-private
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Alexandre Courbot authored and Linus Walleij committed Jul 23, 2014
1 parent 14141a9 commit 1bd6b60
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/gpio/gpiolib-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion drivers/gpio/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpio/gpiolib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 0 additions & 3 deletions include/linux/gpio/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 1bd6b60

Please sign in to comment.