Re: [PATCH 1/2] gpiolib: un-inline gpiod_request_user()

From: Andy Shevchenko
Date: Fri Sep 09 2022 - 09:47:03 EST


On Fri, Sep 09, 2022 at 02:13:28PM +0200, Bartosz Golaszewski wrote:
> Pull this bit of code into gpiolib.c as we're soon be calling certain
> symbols static in this compilation unit.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

> Signed-off-by: Bartosz Golaszewski <brgl@xxxxxxxx>
> ---
> drivers/gpio/gpiolib.c | 11 +++++++++++
> drivers/gpio/gpiolib.h | 12 +-----------
> 2 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index cc9c0a12259e..6768734b9e15 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -2009,6 +2009,17 @@ int gpiod_request(struct gpio_desc *desc, const char *label)
> return ret;
> }
>
> +int gpiod_request_user(struct gpio_desc *desc, const char *label)
> +{
> + int ret;
> +
> + ret = gpiod_request(desc, label);
> + if (ret == -EPROBE_DEFER)
> + ret = -ENODEV;
> +
> + return ret;
> +}
> +
> static bool gpiod_free_commit(struct gpio_desc *desc)
> {
> bool ret = false;
> diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
> index d900ecdbac46..b35deb08a7f5 100644
> --- a/drivers/gpio/gpiolib.h
> +++ b/drivers/gpio/gpiolib.h
> @@ -179,19 +179,9 @@ struct gpio_desc {
> #define gpiod_not_found(desc) (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT)
>
> int gpiod_request(struct gpio_desc *desc, const char *label);
> +int gpiod_request_user(struct gpio_desc *desc, const char *label);
> void gpiod_free(struct gpio_desc *desc);
>
> -static inline int gpiod_request_user(struct gpio_desc *desc, const char *label)
> -{
> - int ret;
> -
> - ret = gpiod_request(desc, label);
> - if (ret == -EPROBE_DEFER)
> - ret = -ENODEV;
> -
> - return ret;
> -}
> -
> int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id,
> unsigned long lflags, enum gpiod_flags dflags);
> int gpio_set_debounce_timeout(struct gpio_desc *desc, unsigned int debounce);
> --
> 2.34.1
>

--
With Best Regards,
Andy Shevchenko