Skip to content

Commit

Permalink
drivers: net: ethernet: cpsw: consider number of slaves in interation
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: Mugunthan V N <mugunthanvnm@ti.com>
Cc: David S. Miller <davem@davemloft.net>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniel Mack authored and David S. Miller committed Feb 26, 2013
1 parent b86c761 commit 0237c11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/ti/cpsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0237c11

Please sign in to comment.