diff mbox

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

Message ID 1361887580-1770-1-git-send-email-zonque@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Daniel Mack Feb. 26, 2013, 2:06 p.m. UTC
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>
---
 drivers/net/ethernet/ti/cpsw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mugunthan V N Feb. 26, 2013, 2:55 p.m. UTC | #1
On 2/26/2013 7:36 PM, Daniel Mack wrote:
> 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>
Looks ok for me

Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Feb. 26, 2013, 10:26 p.m. UTC | #2
From: Mugunthan V N <mugunthanvnm@ti.com>
Date: Tue, 26 Feb 2013 20:25:46 +0530

> On 2/26/2013 7:36 PM, Daniel Mack wrote:
>> 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>
> Looks ok for me
> 
> Acked-by: Mugunthan V N <mugunthanvnm@ti.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 7e93df6..01ffbc4 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -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,