qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 1/7] gpiolib: Add GPIOCHIP_NAME definition


From: Eugeniu Rosca
Subject: Re: [PATCH v3 1/7] gpiolib: Add GPIOCHIP_NAME definition
Date: Mon, 2 Dec 2019 22:17:37 +0100
User-agent: Mutt/1.12.1+40 (7f8642d4ee82) (2019-06-28)

Hi Geert,

On Wed, Nov 27, 2019 at 09:42:47AM +0100, Geert Uytterhoeven wrote:
> The string literal "gpiochip" is used in several places.
> Add a definition for it, and use it everywhere, to make sure everything
> stays in sync.
> 
> Signed-off-by: Geert Uytterhoeven <address@hidden>
> ---
> v3:
>   - New.
> ---
>  drivers/gpio/gpiolib-sysfs.c | 7 +++----
>  drivers/gpio/gpiolib.c       | 4 ++--
>  drivers/gpio/gpiolib.h       | 2 ++
>  3 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
> index ca9bc1e4803c2979..a4a759920faa48ab 100644
> --- a/drivers/gpio/gpiolib.h
> +++ b/drivers/gpio/gpiolib.h
> @@ -16,6 +16,8 @@
>  #include <linux/module.h>
>  #include <linux/cdev.h>
>  
> +#define GPIOCHIP_NAME        "gpiochip"

[.02$/nit] I wonder if GPIOCHIP_NAME is actually an essential
part of kernel-user contract [1-2], in which case it could
probably be moved to include/uapi/linux/gpio.h ?

Regardless:
Reviewed-by: Eugeniu Rosca <address@hidden>

[1] linux (v5.4) git grep '"gpiochip' -- tools/
tools/gpio/lsgpio.c:                    if (check_prefix(ent->d_name, 
"gpiochip")) {
tools/testing/selftests/gpio/gpio-mockup-chardev.c:             if 
(check_prefix(ent->d_name, "gpiochip")) {

[2] libgpiod (v1.4-76-g00418dfdfc8b) git grep '"gpiochip'
lib/iter.c:     return !strncmp(dir->d_name, "gpiochip", 8);
tests/mockup/gpio-mockup.c:     rv = sscanf(sysname, "gpiochip%u", &chip->num);
tools/gpioget.c:                die("gpiochip must be specified");
tools/gpiomon.c:                die("gpiochip must be specified");
tools/gpioset.c:                die("gpiochip must be specified");

-- 
Best Regards,
Eugeniu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]