* [PATCH] pinctrl: use to octal permissions for debugfs files
@ 2021-01-26 4:47 Drew Fustini
2021-02-12 7:58 ` Linus Walleij
0 siblings, 1 reply; 4+ messages in thread
From: Drew Fustini @ 2021-01-26 4:47 UTC (permalink / raw)
To: Linus Walleij, linux-gpio, linux-kernel; +Cc: Drew Fustini
Switch over pinctrl debugfs files to use octal permissions as they are
preferred over symbolic permissions. Refer to commit f90774e1fd27
("checkpatch: look for symbolic permissions and suggest octal instead").
Signed-off-by: Drew Fustini <drew@beagleboard.org>
---
Patch note:
- I learned about this preference of octal over symbolic when I created
an RFC to add a new debugfs file ("pinmux-select"). I am submitting
this patch to switch existing entries in pinctrl over to octal before
I submit a proper PATCH for the "pinmux-select" functionality in which
I will use octal permissions for the new file.
drivers/pinctrl/core.c | 6 +++---
drivers/pinctrl/pinconf.c | 4 ++--
drivers/pinctrl/pinmux.c | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 9fc4433fece4..791736b2de77 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1916,11 +1916,11 @@ static void pinctrl_init_debugfs(void)
return;
}
- debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO,
+ debugfs_create_file("pinctrl-devices", 0400,
debugfs_root, NULL, &pinctrl_devices_fops);
- debugfs_create_file("pinctrl-maps", S_IFREG | S_IRUGO,
+ debugfs_create_file("pinctrl-maps", 0400,
debugfs_root, NULL, &pinctrl_maps_fops);
- debugfs_create_file("pinctrl-handles", S_IFREG | S_IRUGO,
+ debugfs_create_file("pinctrl-handles", 0400,
debugfs_root, NULL, &pinctrl_fops);
}
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c
index 02c075cc010b..f005921bb49e 100644
--- a/drivers/pinctrl/pinconf.c
+++ b/drivers/pinctrl/pinconf.c
@@ -370,9 +370,9 @@ DEFINE_SHOW_ATTRIBUTE(pinconf_groups);
void pinconf_init_device_debugfs(struct dentry *devroot,
struct pinctrl_dev *pctldev)
{
- debugfs_create_file("pinconf-pins", S_IFREG | S_IRUGO,
+ debugfs_create_file("pinconf-pins", 0400,
devroot, pctldev, &pinconf_pins_fops);
- debugfs_create_file("pinconf-groups", S_IFREG | S_IRUGO,
+ debugfs_create_file("pinconf-groups", 0400,
devroot, pctldev, &pinconf_groups_fops);
}
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index bab888fe3f8e..7f6190eaedbb 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -676,9 +676,9 @@ DEFINE_SHOW_ATTRIBUTE(pinmux_pins);
void pinmux_init_device_debugfs(struct dentry *devroot,
struct pinctrl_dev *pctldev)
{
- debugfs_create_file("pinmux-functions", S_IFREG | S_IRUGO,
+ debugfs_create_file("pinmux-functions", 0400,
devroot, pctldev, &pinmux_functions_fops);
- debugfs_create_file("pinmux-pins", S_IFREG | S_IRUGO,
+ debugfs_create_file("pinmux-pins", 0400,
devroot, pctldev, &pinmux_pins_fops);
}
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] pinctrl: use to octal permissions for debugfs files
2021-01-26 4:47 [PATCH] pinctrl: use to octal permissions for debugfs files Drew Fustini
@ 2021-02-12 7:58 ` Linus Walleij
2021-02-12 17:37 ` Drew Fustini
0 siblings, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2021-02-12 7:58 UTC (permalink / raw)
To: Drew Fustini; +Cc: open list:GPIO SUBSYSTEM, linux-kernel
On Tue, Jan 26, 2021 at 5:55 AM Drew Fustini <drew@beagleboard.org> wrote:
> Switch over pinctrl debugfs files to use octal permissions as they are
> preferred over symbolic permissions. Refer to commit f90774e1fd27
> ("checkpatch: look for symbolic permissions and suggest octal instead").
>
> Signed-off-by: Drew Fustini <drew@beagleboard.org>
That's right. Patch applied!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pinctrl: use to octal permissions for debugfs files
2021-02-12 7:58 ` Linus Walleij
@ 2021-02-12 17:37 ` Drew Fustini
2021-02-17 15:49 ` Linus Walleij
0 siblings, 1 reply; 4+ messages in thread
From: Drew Fustini @ 2021-02-12 17:37 UTC (permalink / raw)
To: Linus Walleij; +Cc: open list:GPIO SUBSYSTEM, linux-kernel
On Fri, Feb 12, 2021 at 08:58:58AM +0100, Linus Walleij wrote:
> On Tue, Jan 26, 2021 at 5:55 AM Drew Fustini <drew@beagleboard.org> wrote:
>
> > Switch over pinctrl debugfs files to use octal permissions as they are
> > preferred over symbolic permissions. Refer to commit f90774e1fd27
> > ("checkpatch: look for symbolic permissions and suggest octal instead").
> >
> > Signed-off-by: Drew Fustini <drew@beagleboard.org>
>
> That's right. Patch applied!
>
> Yours,
> Linus Walleij
Thanks, Linus. However, Andy suggested I make this a series as it was
prep for my patch to add 'pinmux-select' to debugfs. I posted it as
part of a 2 patch series [1]. In addition, Joe Perches noticed I forgot
3 instances of debugfs_create_file() in core.c so I was about to fix
that in v5 of the patch series. v5 is mostly addressing comments on the
pinmux-select feature.
Thank you,
Drew
[1] https://lore.kernel.org/linux-gpio/20210210222851.232374-1-drew@beagleboard.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pinctrl: use to octal permissions for debugfs files
2021-02-12 17:37 ` Drew Fustini
@ 2021-02-17 15:49 ` Linus Walleij
0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2021-02-17 15:49 UTC (permalink / raw)
To: Drew Fustini; +Cc: open list:GPIO SUBSYSTEM, linux-kernel
On Fri, Feb 12, 2021 at 6:37 PM Drew Fustini <drew@beagleboard.org> wrote:
> On Fri, Feb 12, 2021 at 08:58:58AM +0100, Linus Walleij wrote:
> > On Tue, Jan 26, 2021 at 5:55 AM Drew Fustini <drew@beagleboard.org> wrote:
> >
> > > Switch over pinctrl debugfs files to use octal permissions as they are
> > > preferred over symbolic permissions. Refer to commit f90774e1fd27
> > > ("checkpatch: look for symbolic permissions and suggest octal instead").
> > >
> > > Signed-off-by: Drew Fustini <drew@beagleboard.org>
> >
> > That's right. Patch applied!
> >
> > Yours,
> > Linus Walleij
>
> Thanks, Linus. However, Andy suggested I make this a series as it was
> prep for my patch to add 'pinmux-select' to debugfs. I posted it as
> part of a 2 patch series [1]. In addition, Joe Perches noticed I forgot
> 3 instances of debugfs_create_file() in core.c so I was about to fix
> that in v5 of the patch series. v5 is mostly addressing comments on the
> pinmux-select feature.
Oh I saw that and pulled it out again, no big deal.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-17 15:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 4:47 [PATCH] pinctrl: use to octal permissions for debugfs files Drew Fustini
2021-02-12 7:58 ` Linus Walleij
2021-02-12 17:37 ` Drew Fustini
2021-02-17 15:49 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).