From: Rafał Miłecki Date: Sat, 2 Jan 2016 20:38:56 +0000 (+0000) Subject: ledtrig-netdev: don't stop timer on events for different interfaces X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b836a7c29d2717785524f94a7a1df3ae7bed8423;p=openwrt%2Fstaging%2Fblocktrron.git ledtrig-netdev: don't stop timer on events for different interfaces This fixes regression introduced in my recent ledtrig-netdev commit. Events triggered by different interfaces were stopping timer so it wasn't working for tx/rx mode. Signed-off-by: Rafał Miłecki SVN-Revision: 48072 --- diff --git a/target/linux/generic/files/drivers/leds/ledtrig-netdev.c b/target/linux/generic/files/drivers/leds/ledtrig-netdev.c index 5d0f95499b..cfa4dc0758 100644 --- a/target/linux/generic/files/drivers/leds/ledtrig-netdev.c +++ b/target/linux/generic/files/drivers/leds/ledtrig-netdev.c @@ -269,11 +269,12 @@ static int netdev_trig_notify(struct notifier_block *nb, return NOTIFY_DONE; spin_lock_bh(&trigger_data->lock); - del_timer_sync(&trigger_data->timer); if (strcmp(dev->name, trigger_data->device_name)) goto done; + del_timer_sync(&trigger_data->timer); + if (evt == NETDEV_REGISTER || evt == NETDEV_CHANGENAME) { if (trigger_data->net_dev != NULL) dev_put(trigger_data->net_dev);