Skip to content

Commit 70409f3

Browse files
AdityaGarg8Jiri Kosina
authored andcommitted
HID: appletb-kbd: Fix inconsistent indentation and pass -ENODEV to dev_err_probe
The following warnings were flagged by the kernel test robot: drivers/hid/hid-appletb-kbd.c:405 appletb_kbd_probe() warn: inconsistent indenting drivers/hid/hid-appletb-kbd.c:406 appletb_kbd_probe() warn: passing zero to 'dev_err_probe' This patch aims at fixing those warnings. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/linux-input/[email protected]/ Fixes: 93a0fc4 ("HID: hid-appletb-kbd: add support for automatic brightness control while using the touchbar") Signed-off-by: Aditya Garg <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 172e23f commit 70409f3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/hid/hid-appletb-kbd.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,13 +402,13 @@ static int appletb_kbd_probe(struct hid_device *hdev, const struct hid_device_id
402402
}
403403

404404
kbd->backlight_dev = backlight_device_get_by_name("appletb_backlight");
405-
if (!kbd->backlight_dev)
406-
dev_err_probe(dev, ret, "Failed to get backlight device\n");
407-
else {
408-
backlight_device_set_brightness(kbd->backlight_dev, 2);
409-
timer_setup(&kbd->inactivity_timer, appletb_inactivity_timer, 0);
410-
mod_timer(&kbd->inactivity_timer, jiffies + msecs_to_jiffies(appletb_tb_dim_timeout * 1000));
411-
}
405+
if (!kbd->backlight_dev) {
406+
dev_err_probe(dev, -ENODEV, "Failed to get backlight device\n");
407+
} else {
408+
backlight_device_set_brightness(kbd->backlight_dev, 2);
409+
timer_setup(&kbd->inactivity_timer, appletb_inactivity_timer, 0);
410+
mod_timer(&kbd->inactivity_timer, jiffies + msecs_to_jiffies(appletb_tb_dim_timeout * 1000));
411+
}
412412

413413
kbd->inp_handler.event = appletb_kbd_inp_event;
414414
kbd->inp_handler.connect = appletb_kbd_inp_connect;

0 commit comments

Comments
 (0)