Skip to content

Commit

Permalink
usbnet: Set parent device early for netdev_printk()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Jul 3, 2010
1 parent 7b00ac5 commit 0dacca7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0dacca7

Please sign in to comment.