summaryrefslogtreecommitdiffstats
path: root/drivers/net/cpsw.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-05-14 16:45:32 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-05-15 13:58:39 +0200
commit6322a0305f0f87b3fcee5386d605925e5f10aefc (patch)
treed6d0a626c95cbd868bf35b591ac0b27b53667adb /drivers/net/cpsw.c
parenta1463175bdb109ad8ce64a27aa08bf2affaf5e8b (diff)
downloadbarebox-6322a0305f0f87b3fcee5386d605925e5f10aefc.tar.gz
barebox-6322a0305f0f87b3fcee5386d605925e5f10aefc.tar.xz
net: cpsw: Always write mac_control register
Instead of keeping track of the mac_control register value and only writing to it when it changed just always write it. This is more safe anyway since the mac_control register content is altered in the soft_reset functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/cpsw.c')
-rw-r--r--drivers/net/cpsw.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 026c0bc092..493092698c 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -178,7 +178,6 @@ struct cpsw_slave {
struct cpsw_slave_regs *regs;
struct cpsw_sliver_regs *sliver;
int slave_num;
- u32 mac_control;
int phy_id;
phy_interface_t phy_if;
struct eth_device edev;
@@ -590,9 +589,6 @@ static void cpsw_slave_update_link(struct cpsw_slave *slave,
mac_control |= BIT(0); /* FULLDUPLEXEN */
}
- if (mac_control == slave->mac_control)
- return;
-
if (mac_control) {
dev_dbg(&slave->dev, "link up, speed %d, %s duplex\n",
phydev->speed,
@@ -602,7 +598,6 @@ static void cpsw_slave_update_link(struct cpsw_slave *slave,
}
writel(mac_control, &slave->sliver->mac_control);
- slave->mac_control = mac_control;
}
static int cpsw_update_link(struct cpsw_slave *slave, struct cpsw_priv *priv)
@@ -649,8 +644,6 @@ static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv)
/* setup max packet size, and mac address */
writel(PKT_MAX, &slave->sliver->rx_maxlen);
- slave->mac_control = 0; /* no link yet */
-
/* enable forwarding */
slave_port = cpsw_get_slave_port(priv, slave->slave_num);
cpsw_ale_port_state(priv, slave_port, ALE_PORT_STATE_FORWARD);