When the phy is connected, an info message is printed. If the netdev
it is attached to has not been registered yet, the name
'uninitialised' in the output. By registering the netdev first, then
connecting they phy, we can avoid this.

Signed-off-by: Andrew Lunn <and...@lunn.ch>
---
 net/dsa/slave.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 68fae0cf17cd..25606c1b963d 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1187,13 +1187,6 @@ int dsa_slave_create(struct dsa_switch *ds, struct 
device *parent,
        p->old_link = -1;
        p->old_duplex = -1;
 
-       ret = dsa_slave_phy_setup(p, slave_dev);
-       if (ret) {
-               netdev_err(master, "error %d setting up slave phy\n", ret);
-               free_netdev(slave_dev);
-               return ret;
-       }
-
        ds->ports[port] = slave_dev;
        ret = register_netdev(slave_dev);
        if (ret) {
@@ -1205,6 +1198,13 @@ int dsa_slave_create(struct dsa_switch *ds, struct 
device *parent,
                return ret;
        }
 
+       ret = dsa_slave_phy_setup(p, slave_dev);
+       if (ret) {
+               netdev_err(master, "error %d setting up slave phy\n", ret);
+               free_netdev(slave_dev);
+               return ret;
+       }
+
        netif_carrier_off(slave_dev);
 
        return 0;
-- 
2.6.4

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

Reply via email to