Search Linux Wireless

[PATCH 3/4] ar9170: fix LED power state handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes a minor visual bug in the led code, which
left the LED in the wrong power state when it was toggled
in a _unexpected_ way (e.g: enabling the LED twice).

Signed-off-by: Christian Lamparter <chunkeey@xxxxxx>
---
diff --git a/drivers/net/wireless/ath/ar9170/led.c b/drivers/net/wireless/ath/ar9170/led.c
index 341cead..ebb1c3e 100644
--- a/drivers/net/wireless/ath/ar9170/led.c
+++ b/drivers/net/wireless/ath/ar9170/led.c
@@ -81,10 +81,10 @@ static void ar9170_update_leds(struct work_struct *work)
 			if (tmp < blink_delay)
 				blink_delay = tmp;
 
-			if (ar->leds[i].toggled > 1)
-				ar->leds[i].toggled = 0;
+			if (ar->leds[i].l.brightness == LED_OFF)
+				rerun = true;
 
-			rerun = true;
+			ar->leds[i].toggled = !!ar->leds[i].l.brightness;
 		}
 
 	ar9170_set_leds_state(ar, led_val);
@@ -103,7 +103,7 @@ static void ar9170_led_brightness_set(struct led_classdev *led,
 
 	arl->toggled++;
 
-	if (likely(IS_ACCEPTING_CMD(ar) && brightness))
+	if (likely(IS_ACCEPTING_CMD(ar)))
 		queue_delayed_work(ar->hw->workqueue, &ar->led_work, HZ/10);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux