ar71xx: swconfig: use the local helper to set LED brightness on link down
authorGabor Juhos <juhosg@openwrt.org>
Sun, 26 Jan 2014 16:46:21 +0000 (16:46 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sun, 26 Jan 2014 16:46:21 +0000 (16:46 +0000)
Use the 'swconfig_trig_set_brightness' function to set
the brightness value of the LED when the link goes down.
This ensures that the last brighness value is saved into
a local variable which is used to track the actual LED
status.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 39402

target/linux/generic/files/drivers/net/phy/swconfig_leds.c

index 2fc5d554d4fe31e6be752c17f61e0498b51b0408..abd7bed48c4a8ce795808d2aff677310966e6070 100644 (file)
@@ -209,7 +209,7 @@ swconfig_trig_led_event(struct switch_led_trigger *sw_trig,
        link = !!(sw_trig->port_link & port_mask);
        if (!link) {
                if (link != trig_data->prev_link)
-                       led_set_brightness(trig_data->led_cdev, LED_OFF);
+                       swconfig_trig_set_brightness(trig_data, LED_OFF);
        } else {
                unsigned long traffic;
                int i;