Skip to content
Snippets Groups Projects
Commit 8f7aa831 authored by Vitaly Kuzmichev's avatar Vitaly Kuzmichev Committed by Remy Bohmer
Browse files

USB-CDC: Do not rename netdev after its registration


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: default avatarVitaly Kuzmichev <vkuzmichev@mvista.com>
parent 988ee3e3
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "gadget_chips.h" #include "gadget_chips.h"
#define USB_NET_NAME "usb0" #define USB_NET_NAME "usb_ether"
#define atomic_read #define atomic_read
extern struct platform_data brd; extern struct platform_data brd;
...@@ -1687,7 +1687,6 @@ autoconf_fail: ...@@ -1687,7 +1687,6 @@ autoconf_fail:
} }
dev->net = &l_netdev; dev->net = &l_netdev;
strcpy(dev->net->name, USB_NET_NAME);
dev->cdc = cdc; dev->cdc = cdc;
dev->zlp = zlp; dev->zlp = zlp;
...@@ -1924,7 +1923,7 @@ int usb_eth_initialize(bd_t *bi) ...@@ -1924,7 +1923,7 @@ int usb_eth_initialize(bd_t *bi)
int status = 0; int status = 0;
struct eth_device *netdev = &l_netdev; 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->init = usb_eth_init;
netdev->send = usb_eth_send; netdev->send = usb_eth_send;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment