Skip to content

Commit a6a5ecc

Browse files
andy-shevBenjamin Tissoires
authored andcommitted
HID: cp2112: Use octal permissions
Octal permissions are preferred as stated in Documentation/dev-tools/checkpatch.rst. Replace symbolic permissions with octal permissions when creating the files. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent 7f75812 commit a6a5ecc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/hid-cp2112.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ struct cp2112_device {
175175
};
176176

177177
static int gpio_push_pull = CP2112_GPIO_ALL_GPIO_MASK;
178-
module_param(gpio_push_pull, int, S_IRUGO | S_IWUSR);
178+
module_param(gpio_push_pull, int, 0644);
179179
MODULE_PARM_DESC(gpio_push_pull, "GPIO push-pull configuration bitmask");
180180

181181
static int cp2112_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
@@ -1057,7 +1057,7 @@ static void chmod_sysfs_attrs(struct hid_device *hdev)
10571057
}
10581058

10591059
for (attr = cp2112_attr_group.attrs; *attr; ++attr) {
1060-
umode_t mode = (buf[1] & 1) ? S_IWUSR | S_IRUGO : S_IRUGO;
1060+
umode_t mode = (buf[1] & 1) ? 0644 : 0444;
10611061
ret = sysfs_chmod_file(&hdev->dev.kobj, *attr, mode);
10621062
if (ret < 0)
10631063
hid_err(hdev, "error chmoding sysfs file %s\n",

0 commit comments

Comments
 (0)