diff options
author | Christian Lamparter <chunkeey@web.de> | 2009-05-25 15:51:19 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-06-03 14:05:15 -0400 |
commit | 2431fe9a4b43ccf03589fa661662da6bfbd97282 (patch) | |
tree | f609096a84180829aea2a2820048c00890d21970 /drivers/net/wireless/ath/ar9170/led.c | |
parent | 95cf8769bba6ea595994f786ea63f7e2948133de (diff) |
ar9170: fix LED power state handling
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@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ar9170/led.c')
-rw-r--r-- | drivers/net/wireless/ath/ar9170/led.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ar9170/led.c b/drivers/net/wireless/ath/ar9170/led.c index 341cead7f606..3c8a5728920d 100644 --- a/drivers/net/wireless/ath/ar9170/led.c +++ b/drivers/net/wireless/ath/ar9170/led.c | |||
@@ -101,9 +101,12 @@ static void ar9170_led_brightness_set(struct led_classdev *led, | |||
101 | struct ar9170_led *arl = container_of(led, struct ar9170_led, l); | 101 | struct ar9170_led *arl = container_of(led, struct ar9170_led, l); |
102 | struct ar9170 *ar = arl->ar; | 102 | struct ar9170 *ar = arl->ar; |
103 | 103 | ||
104 | arl->toggled++; | 104 | if (arl->last_state != !!brightness) { |
105 | arl->toggled++; | ||
106 | arl->last_state = !!brightness; | ||
107 | } | ||
105 | 108 | ||
106 | if (likely(IS_ACCEPTING_CMD(ar) && brightness)) | 109 | if (likely(IS_ACCEPTING_CMD(ar) && arl->toggled)) |
107 | queue_delayed_work(ar->hw->workqueue, &ar->led_work, HZ/10); | 110 | queue_delayed_work(ar->hw->workqueue, &ar->led_work, HZ/10); |
108 | } | 111 | } |
109 | 112 | ||