diff mbox series

pinctrl: use to octal permissions for debugfs files

Message ID 20210126044742.87602-1-drew@beagleboard.org
State New
Headers show
Series pinctrl: use to octal permissions for debugfs files | expand

Commit Message

Drew Fustini Jan. 26, 2021, 4:47 a.m. UTC
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(-)

Comments

Linus Walleij Feb. 12, 2021, 7:58 a.m. UTC | #1
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
Drew Fustini Feb. 12, 2021, 5:37 p.m. UTC | #2
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/
Linus Walleij Feb. 17, 2021, 3:49 p.m. UTC | #3
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
diff mbox series

Patch

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);
 }