pinctrl: use to octal permissions for debugfs files
authorDrew Fustini <drew@beagleboard.org>
Tue, 2 Mar 2021 05:30:56 +0000 (21:30 -0800)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 10 Mar 2021 13:41:58 +0000 (14:41 +0100)
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").

Note: S_IFREG flag is added to the mode by __debugfs_create_file()
in fs/debugfs/inode.c

Suggested-by: Joe Perches <joe@perches.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Drew Fustini <drew@beagleboard.org>
Link: https://lore.kernel.org/r/20210302053059.1049035-2-drew@beagleboard.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/core.c
drivers/pinctrl/pinconf.c
drivers/pinctrl/pinmux.c

index 7d3370289938cb52d36d66da4b0492f02d36d92c..6ddf2bc36f15ae574a99ca7dd6edada6531c3406 100644 (file)
@@ -1890,11 +1890,11 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev)
                        dev_name(pctldev->dev));
                return;
        }
-       debugfs_create_file("pins", S_IFREG | S_IRUGO,
+       debugfs_create_file("pins", 0444,
                            device_root, pctldev, &pinctrl_pins_fops);
-       debugfs_create_file("pingroups", S_IFREG | S_IRUGO,
+       debugfs_create_file("pingroups", 0444,
                            device_root, pctldev, &pinctrl_groups_fops);
-       debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO,
+       debugfs_create_file("gpio-ranges", 0444,
                            device_root, pctldev, &pinctrl_gpioranges_fops);
        if (pctldev->desc->pmxops)
                pinmux_init_device_debugfs(device_root, pctldev);
@@ -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", 0444,
                            debugfs_root, NULL, &pinctrl_devices_fops);
-       debugfs_create_file("pinctrl-maps", S_IFREG | S_IRUGO,
+       debugfs_create_file("pinctrl-maps", 0444,
                            debugfs_root, NULL, &pinctrl_maps_fops);
-       debugfs_create_file("pinctrl-handles", S_IFREG | S_IRUGO,
+       debugfs_create_file("pinctrl-handles", 0444,
                            debugfs_root, NULL, &pinctrl_fops);
 }
 
index 02c075cc010b10b5925c665bababc51daf1458e9..d9d54065472eb31c89ee552e98f82aa6566ace12 100644 (file)
@@ -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", 0444,
                            devroot, pctldev, &pinconf_pins_fops);
-       debugfs_create_file("pinconf-groups", S_IFREG | S_IRUGO,
+       debugfs_create_file("pinconf-groups", 0444,
                            devroot, pctldev, &pinconf_groups_fops);
 }
 
index 36a11c9e893ad78e02f71625d7afc6997e18bb41..9c0174520e78d6071e2f6e8661009dfd97c57fd9 100644 (file)
@@ -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", 0444,
                            devroot, pctldev, &pinmux_functions_fops);
-       debugfs_create_file("pinmux-pins", S_IFREG | S_IRUGO,
+       debugfs_create_file("pinmux-pins", 0444,
                            devroot, pctldev, &pinmux_pins_fops);
 }