[PATCH v3 3/3] HID: appletb-kbd: Fix inconsistent indentation and pass -ENODEV to dev_err_probe

From: Aditya Garg
Date: Sat Feb 15 2025 - 13:41:28 EST


From: Aditya Garg <gargaditya08@xxxxxxxx>

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@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202502152006.fBBCdEr3-lkp@xxxxxxxxx/
Signed-off-by: Aditya Garg <gargaditya08@xxxxxxxx>
---
drivers/hid/hid-appletb-kbd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/hid-appletb-kbd.c b/drivers/hid/hid-appletb-kbd.c
index e45cc3ac4..200db518a 100644
--- a/drivers/hid/hid-appletb-kbd.c
+++ b/drivers/hid/hid-appletb-kbd.c
@@ -402,9 +402,9 @@ 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 {
+ 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));
--
2.43.0