Skip to contentSkip to conversation

drivers: net: ethernet: cpsw: consider number of slaves in interation

PATCH Applied Daniel Mack 3 participants 3 messages Feb 26, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: net: ethernet: cpsw: consider number of slaves in interation

Make cpsw_add_default_vlan() look at the actual number of slaves for its iteration, so boards with less than 2 slaves don't ooops at boot.

Cc Mugunthan V N <[email protected]>
Cc David S. Miller <[email protected]>
---
 drivers/net/ethernet/ti/cpsw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/ti/cpsw.c +1 -1
index 7e93df6..01ffbc4 100644
@@ -731,7 +731,7 @@ static inline void cpsw_add_default_vlan(struct cpsw_priv *priv)
 
 	writel(vlan, &priv->host_port_regs->port_vlan);
 
-	for (i = 0; i < 2; i++)
+	for (i = 0; i < priv->data.slaves; i++)
 		slave_write(priv->slaves + i, vlan, reg);
 
 	cpsw_ale_add_vlan(priv->ale, vlan, ALE_ALL_PORTS << port,
Signature · 1 line
1.8.1.2
maintainer Applied
#2 lore raw

From: Mugunthan V N <[email protected]>
Date: Tue, 26 Feb 2013 20:25:46 +0530

Quoted 11 lines · Daniel Mack
Quoted 7 lines

Make cpsw_add_default_vlan() look at the actual number of slaves for its
iteration, so boards with less than 2 slaves don't ooops at boot.

Cc Mugunthan V N <[email protected]>
Cc David S. Miller <[email protected]>

Looks ok for me

Applied, thanks.