Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: use to octal permissions for debugfs files

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>

authored by

Drew Fustini and committed by
Linus Walleij
47473813 d2cd54c2

+10 -10
+6 -6
drivers/pinctrl/core.c
··· 1890 1890 dev_name(pctldev->dev)); 1891 1891 return; 1892 1892 } 1893 - debugfs_create_file("pins", S_IFREG | S_IRUGO, 1893 + debugfs_create_file("pins", 0444, 1894 1894 device_root, pctldev, &pinctrl_pins_fops); 1895 - debugfs_create_file("pingroups", S_IFREG | S_IRUGO, 1895 + debugfs_create_file("pingroups", 0444, 1896 1896 device_root, pctldev, &pinctrl_groups_fops); 1897 - debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO, 1897 + debugfs_create_file("gpio-ranges", 0444, 1898 1898 device_root, pctldev, &pinctrl_gpioranges_fops); 1899 1899 if (pctldev->desc->pmxops) 1900 1900 pinmux_init_device_debugfs(device_root, pctldev); ··· 1916 1916 return; 1917 1917 } 1918 1918 1919 - debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO, 1919 + debugfs_create_file("pinctrl-devices", 0444, 1920 1920 debugfs_root, NULL, &pinctrl_devices_fops); 1921 - debugfs_create_file("pinctrl-maps", S_IFREG | S_IRUGO, 1921 + debugfs_create_file("pinctrl-maps", 0444, 1922 1922 debugfs_root, NULL, &pinctrl_maps_fops); 1923 - debugfs_create_file("pinctrl-handles", S_IFREG | S_IRUGO, 1923 + debugfs_create_file("pinctrl-handles", 0444, 1924 1924 debugfs_root, NULL, &pinctrl_fops); 1925 1925 } 1926 1926
+2 -2
drivers/pinctrl/pinconf.c
··· 370 370 void pinconf_init_device_debugfs(struct dentry *devroot, 371 371 struct pinctrl_dev *pctldev) 372 372 { 373 - debugfs_create_file("pinconf-pins", S_IFREG | S_IRUGO, 373 + debugfs_create_file("pinconf-pins", 0444, 374 374 devroot, pctldev, &pinconf_pins_fops); 375 - debugfs_create_file("pinconf-groups", S_IFREG | S_IRUGO, 375 + debugfs_create_file("pinconf-groups", 0444, 376 376 devroot, pctldev, &pinconf_groups_fops); 377 377 } 378 378
+2 -2
drivers/pinctrl/pinmux.c
··· 676 676 void pinmux_init_device_debugfs(struct dentry *devroot, 677 677 struct pinctrl_dev *pctldev) 678 678 { 679 - debugfs_create_file("pinmux-functions", S_IFREG | S_IRUGO, 679 + debugfs_create_file("pinmux-functions", 0444, 680 680 devroot, pctldev, &pinmux_functions_fops); 681 - debugfs_create_file("pinmux-pins", S_IFREG | S_IRUGO, 681 + debugfs_create_file("pinmux-pins", 0444, 682 682 devroot, pctldev, &pinmux_pins_fops); 683 683 } 684 684