2023-05-17 06:11:29

by Zev Weiss

[permalink] [raw]
Subject: [PATCH] gpio: mockup: Fix mode of debugfs files

This driver's debugfs files have had a read operation since commit
2a9e27408e12 ("gpio: mockup: rework debugfs interface"), but were
still being created with write-only mode bits. Update them to
indicate that the files can also be read.

Signed-off-by: Zev Weiss <[email protected]>
Fixes: 2a9e27408e12 ("gpio: mockup: rework debugfs interface")
Cc: [email protected] # v5.1+
---
drivers/gpio/gpio-mockup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c
index e6a7049bef64..b32063ac845a 100644
--- a/drivers/gpio/gpio-mockup.c
+++ b/drivers/gpio/gpio-mockup.c
@@ -369,7 +369,7 @@ static void gpio_mockup_debugfs_setup(struct device *dev,
priv->offset = i;
priv->desc = gpiochip_get_desc(gc, i);

- debugfs_create_file(name, 0200, chip->dbg_dir, priv,
+ debugfs_create_file(name, 0600, chip->dbg_dir, priv,
&gpio_mockup_debugfs_ops);
}
}
--
2.40.1



2023-05-17 09:29:34

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH] gpio: mockup: Fix mode of debugfs files

On Wed, May 17, 2023 at 7:50 AM Zev Weiss <[email protected]> wrote:
>
> This driver's debugfs files have had a read operation since commit
> 2a9e27408e12 ("gpio: mockup: rework debugfs interface"), but were
> still being created with write-only mode bits. Update them to
> indicate that the files can also be read.
>
> Signed-off-by: Zev Weiss <[email protected]>
> Fixes: 2a9e27408e12 ("gpio: mockup: rework debugfs interface")
> Cc: [email protected] # v5.1+
> ---
> drivers/gpio/gpio-mockup.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c
> index e6a7049bef64..b32063ac845a 100644
> --- a/drivers/gpio/gpio-mockup.c
> +++ b/drivers/gpio/gpio-mockup.c
> @@ -369,7 +369,7 @@ static void gpio_mockup_debugfs_setup(struct device *dev,
> priv->offset = i;
> priv->desc = gpiochip_get_desc(gc, i);
>
> - debugfs_create_file(name, 0200, chip->dbg_dir, priv,
> + debugfs_create_file(name, 0600, chip->dbg_dir, priv,
> &gpio_mockup_debugfs_ops);
> }
> }
> --
> 2.40.1
>

Good catch, applied, thanks!

Bart