Skip to contentSkip to conversation

led_class: fix typo in blink API

PATCH In review Johannes Berg 1 participant 2 messages Nov 27, 2010 – Dec 18, 2010 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 led_class: fix typo in blink API

From: Johannes Berg <[email protected]>

When I added led_blink_set I had a typo: the return value of the hw offload is a regular error code that is zero when succesful, and in that case software emulation should not
be used, rather than the other way around.

---
It'd be nice to get this into 2.6.37 since the patch that has the bug is in there. Sorry about that -- I had tested the software implementation extensively but apparently never tested the hw offload part.

 drivers/leds/led-class.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/led-class.c +1 -1
@@ -267,7 +267,7 @@ void led_blink_set(struct led_classdev *
 		   unsigned long *delay_off)
 {
 	if (led_cdev->blink_set &&
-	    led_cdev->blink_set(led_cdev, delay_on, delay_off))
+	    !led_cdev->blink_set(led_cdev, delay_on, delay_off))
 		return;
 
 	/* blink with 1 Hz as default if nothing specified */
#1 lore raw
Quoted 8 lines · Johannes Berg

From: Johannes Berg <[email protected]>

When I added led_blink_set I had a typo: the return value of the hw offload is a regular error code that is zero when succesful, and in that case software emulation should not
be used, rather than the other way around.

Quoted 6 lines

---
It'd be nice to get this into 2.6.37 since the patch that has the bug is in there. Sorry about that -- I had tested the software implementation extensively but apparently never tested the hw offload part.

Any chance of this getting in still?

johannes