From: Ivan Khoronzhuk Date: Sat, 10 Dec 2016 12:23:46 +0000 (+0200) Subject: net: ethernet: ti: cpsw: use same macros to get active slave X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cb7d78d045579831fbf40112f93bf2064a7ef14f;p=linux-beck.git net: ethernet: ti: cpsw: use same macros to get active slave Use the same, more convenient macros, to get active slave. Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index b62d958c5fae..c45f7d2100df 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -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) {