diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2015-12-23 17:13:04 +0000 |
---|---|---|
committer | Rafał Miłecki <zajec5@gmail.com> | 2015-12-23 17:13:04 +0000 |
commit | b6657f9e15b0a51e1f1147c6343f90edb544a000 (patch) | |
tree | d73711695af9a6f767a715b5d239c6dac907bc4e /target/linux | |
parent | e73823d287d03d9bc11b43ce37836c38cab1f55f (diff) | |
download | upstream-b6657f9e15b0a51e1f1147c6343f90edb544a000.tar.gz upstream-b6657f9e15b0a51e1f1147c6343f90edb544a000.tar.bz2 upstream-b6657f9e15b0a51e1f1147c6343f90edb544a000.zip |
ledtrig-netdev: reset link status & stats after changing device_name
Previously switching to non-existing device (interface) could result in
leaving LED on.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Backport of r47990
git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@47992 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/generic/files/drivers/leds/ledtrig-netdev.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/leds/ledtrig-netdev.c b/target/linux/generic/files/drivers/leds/ledtrig-netdev.c index 4e0844a597..4e0fd667b0 100644 --- a/target/linux/generic/files/drivers/leds/ledtrig-netdev.c +++ b/target/linux/generic/files/drivers/leds/ledtrig-netdev.c @@ -122,6 +122,8 @@ static ssize_t led_device_name_store(struct device *dev, strcpy(trigger_data->device_name, buf); if (size > 0 && trigger_data->device_name[size-1] == '\n') trigger_data->device_name[size-1] = 0; + trigger_data->link_up = 0; + trigger_data->last_activity = 0; if (trigger_data->device_name[0] != 0) { /* check for existing device to update from */ |