gpio: export add/remove lookup table functions

Submitted by Anatolij Gustschin on April 20, 2017, 9:23 p.m.

Details

Message ID 1492723400-16657-1-git-send-email-agust@denx.de
State New
Headers show

Commit Message

Anatolij Gustschin April 20, 2017, 9:23 p.m.
For hot-pluggable devices adding GPIOs dynamically we need to
assemble and add the gpio lookup tables at probe time in modules,
so that requesting these GPIOs in attached drivers can work.
Export lookup table functions for modules.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 drivers/gpio/gpiolib.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andy Shevchenko April 21, 2017, 7:24 p.m.
On Fri, Apr 21, 2017 at 12:23 AM, Anatolij Gustschin <agust@denx.de> wrote:
> For hot-pluggable devices adding GPIOs dynamically we need to
> assemble and add the gpio lookup tables at probe time in modules,
> so that requesting these GPIOs in attached drivers can work.
> Export lookup table functions for modules.
>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>

...and still a question "Do we go with stubs for them in case of !GPIOLIB?"

Patch below looks good to me:
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> ---
>  drivers/gpio/gpiolib.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 4aa1e78..9196b1e 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -3008,6 +3008,7 @@ void gpiod_add_lookup_table(struct gpiod_lookup_table *table)
>
>         mutex_unlock(&gpio_lookup_lock);
>  }
> +EXPORT_SYMBOL_GPL(gpiod_add_lookup_table);
>
>  /**
>   * gpiod_remove_lookup_table() - unregister GPIO device consumers
> @@ -3021,6 +3022,7 @@ void gpiod_remove_lookup_table(struct gpiod_lookup_table *table)
>
>         mutex_unlock(&gpio_lookup_lock);
>  }
> +EXPORT_SYMBOL_GPL(gpiod_remove_lookup_table);
>
>  static struct gpiod_lookup_table *gpiod_find_lookup_table(struct device *dev)
>  {
> --
> 2.7.4
>
Anatolij Gustschin April 24, 2017, 2:08 p.m.
On Fri, 21 Apr 2017 22:24:49 +0300
Andy Shevchenko andy.shevchenko@gmail.com wrote:
...
>...and still a question "Do we go with stubs for them in case of !GPIOLIB?"

I've just sent a patch.

>Patch below looks good to me:

Thanks for review!

Anatolij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch hide | download patch | download mbox

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 4aa1e78..9196b1e 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -3008,6 +3008,7 @@  void gpiod_add_lookup_table(struct gpiod_lookup_table *table)
 
 	mutex_unlock(&gpio_lookup_lock);
 }
+EXPORT_SYMBOL_GPL(gpiod_add_lookup_table);
 
 /**
  * gpiod_remove_lookup_table() - unregister GPIO device consumers
@@ -3021,6 +3022,7 @@  void gpiod_remove_lookup_table(struct gpiod_lookup_table *table)
 
 	mutex_unlock(&gpio_lookup_lock);
 }
+EXPORT_SYMBOL_GPL(gpiod_remove_lookup_table);
 
 static struct gpiod_lookup_table *gpiod_find_lookup_table(struct device *dev)
 {