net: ethernet: ti: cpsw: use same macros to get active slave
authorIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Sat, 10 Dec 2016 12:23:46 +0000 (14:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Dec 2016 22:29:47 +0000 (17:29 -0500)
Use the same, more convenient macros, to get active slave.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c

index b62d958c5faed7e3bf3b7f0ffc097a963936cb0e..c45f7d2100dfdb3248221936eca4f36c12d61540 100644 (file)
@@ -1624,10 +1624,7 @@ static void cpsw_hwtstamp_v2(struct cpsw_priv *priv)
        struct cpsw_common *cpsw = priv->cpsw;
        u32 ctrl, mtype;
 
-       if (cpsw->data.dual_emac)
-               slave = &cpsw->slaves[priv->emac_port];
-       else
-               slave = &cpsw->slaves[cpsw->data.active_slave];
+       slave = &cpsw->slaves[cpsw_slave_index(cpsw, priv)];
 
        ctrl = slave_read(slave, CPSW2_CONTROL);
        switch (cpsw->version) {