summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib-of.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-12-04 15:13:53 +0100
committerLinus Walleij <linus.walleij@linaro.org>2016-01-05 11:20:12 +0100
commit3208b0f0c010b26e4d461a3bca59989d03ed9087 (patch)
tree780145509a890886443fa03fa9ef0444725f51ae /drivers/gpio/gpiolib-of.c
parentb08ea35a3296ee25c4cb53a977b752266dafa2c2 (diff)
gpio: of: provide optional of_mm_gpiochip_add_data() function
In the same spirit as we add an optional void *data argument to the gpiochip_add_data() call, we need this also for of_mm_gpiochip_add(). Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib-of.c')
-rw-r--r--drivers/gpio/gpiolib-of.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 6ed465ea2e12..42a4bb7cf49a 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -262,9 +262,10 @@ int of_gpio_simple_xlate(struct gpio_chip *gc,
EXPORT_SYMBOL(of_gpio_simple_xlate);
/**
- * of_mm_gpiochip_add - Add memory mapped GPIO chip (bank)
+ * of_mm_gpiochip_add_data - Add memory mapped GPIO chip (bank)
* @np: device node of the GPIO chip
* @mm_gc: pointer to the of_mm_gpio_chip allocated structure
+ * @data: driver data to store in the struct gpio_chip
*
* To use this function you should allocate and fill mm_gc with:
*
@@ -280,8 +281,9 @@ EXPORT_SYMBOL(of_gpio_simple_xlate);
* do all necessary work for you. Then you'll able to use .regs
* to manage GPIOs from the callbacks.
*/
-int of_mm_gpiochip_add(struct device_node *np,
- struct of_mm_gpio_chip *mm_gc)
+int of_mm_gpiochip_add_data(struct device_node *np,
+ struct of_mm_gpio_chip *mm_gc,
+ void *data)
{
int ret = -ENOMEM;
struct gpio_chip *gc = &mm_gc->gc;
@@ -301,7 +303,7 @@ int of_mm_gpiochip_add(struct device_node *np,
mm_gc->gc.of_node = np;
- ret = gpiochip_add(gc);
+ ret = gpiochip_add_data(gc, data);
if (ret)
goto err2;
@@ -315,7 +317,7 @@ err0:
np->full_name, ret);
return ret;
}
-EXPORT_SYMBOL(of_mm_gpiochip_add);
+EXPORT_SYMBOL(of_mm_gpiochip_add_data);
/**
* of_mm_gpiochip_remove - Remove memory mapped GPIO chip (bank)