Skip to contentSkip to conversation

hid: thingm: remove not needed error message

PATCH Applied Heiner Kallweit 3 participants 3 messages Apr 20, 2016 – Apr 25, 2016 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hid: thingm: remove not needed error message

LED core takes care of handling failed calls to thingm_let_set.
- print error message in set_brightness_delayed or
- pass error to caller in led_set_brightness_sync
Also the error message here doesn't provide any hint what actually went wrong. Therefore remove it.

---
 drivers/hid/hid-thingm.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/hid/hid-thingm.c +1 -6
index 2507bbe..9ad9c6e 100644
@@ -148,13 +148,8 @@ static int thingm_led_set(struct led_classdev *ldev,
 			  enum led_brightness brightness)
 {
 	struct thingm_led *led = container_of(ldev, struct thingm_led, ldev);
-	int ret;
-
-	ret = thingm_write_color(led->rgb);
-	if (ret)
-		hid_err(led->rgb->tdev->hdev, "failed to write color\n");
 
-	return ret;
+	return thingm_write_color(led->rgb);
 }
 
 static int thingm_init_led(struct thingm_led *led, const char *color_name,
Signature · 1 line
2.8.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Heiner Kallweit

LED core takes care of handling failed calls to thingm_let_set.
- print error message in set_brightness_delayed or
- pass error to caller in led_set_brightness_sync
Also the error message here doesn't provide any hint what actually went wrong. Therefore remove it.

Works for me:

Quoted 26 lines
---
 drivers/hid/hid-thingm.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/hid/hid-thingm.c +1 -6
index 2507bbe..9ad9c6e 100644
@@ -148,13 +148,8 @@ static int thingm_led_set(struct led_classdev *ldev,
 			  enum led_brightness brightness)
 {
 	struct thingm_led *led = container_of(ldev, struct thingm_led, ldev);
-	int ret;
-
-	ret = thingm_write_color(led->rgb);
-	if (ret)
-		hid_err(led->rgb->tdev->hdev, "failed to write color\n");
 
-	return ret;
+	return thingm_write_color(led->rgb);
 }
 
 static int thingm_init_led(struct thingm_led *led, const char *color_name,
Signature · 1 line
2.8.0
maintainer Applied
#2 lore raw
In reply to Heiner Kallweit
Quoted 7 lines · Heiner Kallweit

LED core takes care of handling failed calls to thingm_let_set.
- print error message in set_brightness_delayed or
- pass error to caller in led_set_brightness_sync
Also the error message here doesn't provide any hint what actually went wrong. Therefore remove it.

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs