net: ethernet: ti: ale: disable ale from stop()
authorGrygorii Strashko <grygorii.strashko@ti.com>
Fri, 1 Dec 2017 00:21:16 +0000 (18:21 -0600)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Dec 2017 21:36:32 +0000 (16:36 -0500)
ALE is enabled from cpsw_ale_start() now, but disabled only from
cpsw_ale_destroy() which introduces inconsitance as cpsw_ale_start() is
called when netif[s] is opened, but cpsw_ale_destroy() is called when
driver is removed. Hence, move ALE disabling in cpsw_ale_stop().

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw_ale.c

index fca5c29ef5f5713047944a52c65e4628f85f66a0..5eaaf8896941da0711af6eee7f72061e6ddf6e3a 100644 (file)
@@ -870,6 +870,7 @@ EXPORT_SYMBOL_GPL(cpsw_ale_start);
 void cpsw_ale_stop(struct cpsw_ale *ale)
 {
        del_timer_sync(&ale->timer);
+       cpsw_ale_control_set(ale, 0, ALE_ENABLE, 0);
 }
 EXPORT_SYMBOL_GPL(cpsw_ale_stop);
 
@@ -892,7 +893,6 @@ int cpsw_ale_destroy(struct cpsw_ale *ale)
 {
        if (!ale)
                return -EINVAL;
-       cpsw_ale_control_set(ale, 0, ALE_ENABLE, 0);
        kfree(ale);
        return 0;
 }