Re: [PATCH v1 3/3] gpiolib: Move gpiodevice_*() to gpiodev namespace

From: Bartosz Golaszewski
Date: Wed Mar 08 2023 - 05:50:15 EST


On Tue, Mar 7, 2023 at 7:25 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> The functions that operates on the same device object would
> have the same namespace for better code understanding and
> maintenance.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
> drivers/gpio/gpiolib.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index a44a1b0f2766..45f79aee451a 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -573,7 +573,7 @@ bool gpiochip_line_is_valid(const struct gpio_chip *gc,
> }
> EXPORT_SYMBOL_GPL(gpiochip_line_is_valid);
>
> -static void gpiodevice_release(struct device *dev)
> +static void gpiodev_release(struct device *dev)
> {
> struct gpio_device *gdev = to_gpio_device(dev);
> unsigned long flags;
> @@ -617,7 +617,7 @@ static int gpiochip_setup_dev(struct gpio_device *gdev)
> return ret;
>
> /* From this point, the .release() function cleans up gpio_device */
> - gdev->dev.release = gpiodevice_release;
> + gdev->dev.release = gpiodev_release;
>
> ret = gpiochip_sysfs_register(gdev);
> if (ret)
> --
> 2.39.1
>

But the only other function that's in the gpiodev_ namespace operates
on struct gpio_device so that change doesn't make much sense to me.

Bart