Re: [PATCH net-next 3/9] net: dsa: Provide unique DSA slave MII bus names

2016-06-06 Thread Vivien Didelot
Florian Fainelli  writes:

> In case we have multiples trees and switches with the same index, we
> need to add another discriminating id: the switch tree.
>
> Signed-off-by: Florian Fainelli 

Reviewed-by: Vivien Didelot 


Re: [PATCH net-next 3/9] net: dsa: Provide unique DSA slave MII bus names

2016-06-04 Thread Andrew Lunn
On Fri, Jun 03, 2016 at 05:05:25PM -0700, Florian Fainelli wrote:
> In case we have multiples trees and switches with the same index, we
> need to add another discriminating id: the switch tree.
> 
> Signed-off-by: Florian Fainelli 

Reviewed-by: Andrew Lunn 

 Andrew


[PATCH net-next 3/9] net: dsa: Provide unique DSA slave MII bus names

2016-06-03 Thread Florian Fainelli
In case we have multiples trees and switches with the same index, we
need to add another discriminating id: the switch tree.

Signed-off-by: Florian Fainelli 
---
 net/dsa/slave.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 15a492261895..a51dfedf0014 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -49,7 +49,8 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
ds->slave_mii_bus->name = "dsa slave smi";
ds->slave_mii_bus->read = dsa_slave_phy_read;
ds->slave_mii_bus->write = dsa_slave_phy_write;
-   snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d", ds->index);
+   snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d.%d",
+ds->dst->tree, ds->index);
ds->slave_mii_bus->parent = ds->dev;
ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask;
 }
-- 
2.7.4