xtensa: ISS: init network interface name before the probe
authorMax Filippov <jcmvbkbc@gmail.com>
Sun, 10 Nov 2013 12:05:46 +0000 (16:05 +0400)
committerChris Zankel <chris@zankel.net>
Tue, 14 Jan 2014 18:19:49 +0000 (10:19 -0800)
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
arch/xtensa/platforms/iss/network.c

index 0c7c1d4141dbd84a62d6c9125c91bce519fb63ce..3718cff3909aa730247dcda7eee2997c11ed6539 100644 (file)
@@ -544,6 +544,13 @@ static int iss_net_configure(int index, char *init)
                .have_mac               = 0,
                };
 
+       /*
+        * If this name ends up conflicting with an existing registered
+        * netdevice, that is OK, register_netdev{,ice}() will notice this
+        * and fail.
+        */
+       snprintf(dev->name, sizeof(dev->name), "eth%d", index);
+
        /*
         * Try all transport protocols.
         * Note: more protocols can be added by adding '&& !X_init(lp, eth)'.
@@ -575,13 +582,6 @@ static int iss_net_configure(int index, char *init)
        platform_device_register(&lp->pdev);
        SET_NETDEV_DEV(dev, &lp->pdev.dev);
 
-       /*
-        * If this name ends up conflicting with an existing registered
-        * netdevice, that is OK, register_netdev{,ice}() will notice this
-        * and fail.
-        */
-       snprintf(dev->name, sizeof(dev->name), "eth%d", index);
-
        dev->netdev_ops = &iss_netdev_ops;
        dev->mtu = lp->mtu;
        dev->watchdog_timeo = (HZ >> 1);