diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2010-07-03 06:49:02 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-03 06:49:02 +0200 |
commit | 0dacca73a3ddefa6cb8a7e0282f938e01faa1a64 (patch) | |
tree | c97d70af9b4178ddf9284a376aa10d8882d84fa8 /drivers/net | |
parent | net: Revert "rndis_host: Poll status channel before control channel" (diff) | |
download | linux-0dacca73a3ddefa6cb8a7e0282f938e01faa1a64.tar.xz linux-0dacca73a3ddefa6cb8a7e0282f938e01faa1a64.zip |
usbnet: Set parent device early for netdev_printk()
netdev_printk() follows the net_device's parent device pointer, so
we must set that earlier than we previously did.
Reported-by: Luís Picciochi Oliveira <pitxyoki@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/usb/usbnet.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index a95c73de5824..81c76ada8e56 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1293,6 +1293,9 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) goto out; } + /* netdev_printk() needs this so do it as early as possible */ + SET_NETDEV_DEV(net, &udev->dev); + dev = netdev_priv(net); dev->udev = xdev; dev->intf = udev; @@ -1377,8 +1380,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) dev->rx_urb_size = dev->hard_mtu; dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1); - SET_NETDEV_DEV(net, &udev->dev); - if ((dev->driver_info->flags & FLAG_WLAN) != 0) SET_NETDEV_DEVTYPE(net, &wlan_type); if ((dev->driver_info->flags & FLAG_WWAN) != 0) |