summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/u_ether.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/function/u_ether.c')
-rw-r--r--drivers/usb/gadget/function/u_ether.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index 85a3f6d4b5af..e0ad5aed6ac9 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -754,6 +754,7 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g,
struct eth_dev *dev;
struct net_device *net;
int status;
+ u8 addr[ETH_ALEN];
net = alloc_etherdev(sizeof *dev);
if (!net)
@@ -773,9 +774,10 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g,
dev->qmult = qmult;
snprintf(net->name, sizeof(net->name), "%s%%d", netname);
- if (get_ether_addr(dev_addr, net->dev_addr))
+ if (get_ether_addr(dev_addr, addr))
dev_warn(&g->dev,
"using random %s ethernet address\n", "self");
+ eth_hw_addr_set(net, addr);
if (get_ether_addr(host_addr, dev->host_mac))
dev_warn(&g->dev,
"using random %s ethernet address\n", "host");