]> git.sur5r.net Git - u-boot/commitdiff
USB-CDC: Do not rename netdev after its registration
authorVitaly Kuzmichev <vkuzmichev@mvista.com>
Tue, 28 Dec 2010 13:59:31 +0000 (16:59 +0300)
committerRemy Bohmer <linux@bohmer.net>
Wed, 19 Jan 2011 16:29:55 +0000 (17:29 +0100)
Calling eth_bind at usb_eth_init time causes renaming of the network
device from 'usb_ether' to 'usb0'. Fixing this to keep the first name.

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
drivers/usb/gadget/ether.c

index 261cf7ef272723b3741dbf13d5d180e151adbd4d..765fbd8567548b65d785f8210c5d5168f2b1f910 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "gadget_chips.h"
 
-#define USB_NET_NAME "usb0"
+#define USB_NET_NAME "usb_ether"
 
 #define atomic_read
 extern struct platform_data brd;
@@ -1687,7 +1687,6 @@ autoconf_fail:
        }
 
        dev->net = &l_netdev;
-       strcpy(dev->net->name, USB_NET_NAME);
 
        dev->cdc = cdc;
        dev->zlp = zlp;
@@ -1924,7 +1923,7 @@ int usb_eth_initialize(bd_t *bi)
        int status = 0;
        struct eth_device *netdev = &l_netdev;
 
-       sprintf(netdev->name, "usb_ether");
+       strlcpy(netdev->name, USB_NET_NAME, sizeof(netdev->name));
 
        netdev->init = usb_eth_init;
        netdev->send = usb_eth_send;