diff options
author | 2025-02-17 04:46:05 +0000 | |
---|---|---|
committer | 2025-02-18 22:01:54 +0100 | |
commit | 70409f3bc0c0f47bc4be05658395b7eb825e8a59 (patch) | |
tree | 71f2711c52940f0578cf6d340c9e6abf6dbf8742 | |
parent | HID: hid-appletb-bl: fix incorrect error message for default brightness (diff) | |
download | wireguard-linux-70409f3bc0c0f47bc4be05658395b7eb825e8a59.tar.xz wireguard-linux-70409f3bc0c0f47bc4be05658395b7eb825e8a59.zip |
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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202502152006.fBBCdEr3-lkp@intel.com/
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-input/6263a1a2-4d50-41db-aa54-cfcb3e0523a4@stanley.mountain/
Fixes: 93a0fc489481 ("HID: hid-appletb-kbd: add support for automatic brightness control while using the touchbar")
Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
-rw-r--r-- | drivers/hid/hid-appletb-kbd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/hid/hid-appletb-kbd.c b/drivers/hid/hid-appletb-kbd.c index e45cc3ac46ee..d4b95aa3eecb 100644 --- a/drivers/hid/hid-appletb-kbd.c +++ b/drivers/hid/hid-appletb-kbd.c @@ -402,13 +402,13 @@ static int appletb_kbd_probe(struct hid_device *hdev, const struct hid_device_id } kbd->backlight_dev = backlight_device_get_by_name("appletb_backlight"); - if (!kbd->backlight_dev) - dev_err_probe(dev, ret, "Failed to get backlight device\n"); - else { - backlight_device_set_brightness(kbd->backlight_dev, 2); - timer_setup(&kbd->inactivity_timer, appletb_inactivity_timer, 0); - mod_timer(&kbd->inactivity_timer, jiffies + msecs_to_jiffies(appletb_tb_dim_timeout * 1000)); - } + if (!kbd->backlight_dev) { + dev_err_probe(dev, -ENODEV, "Failed to get backlight device\n"); + } else { + backlight_device_set_brightness(kbd->backlight_dev, 2); + timer_setup(&kbd->inactivity_timer, appletb_inactivity_timer, 0); + mod_timer(&kbd->inactivity_timer, jiffies + msecs_to_jiffies(appletb_tb_dim_timeout * 1000)); + } kbd->inp_handler.event = appletb_kbd_inp_event; kbd->inp_handler.connect = appletb_kbd_inp_connect; |