Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0dacca73 authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller
Browse files

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: default avatarLuís Picciochi Oliveira <pitxyoki@gmail.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7b00ac51
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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)