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

Commit e3ad412a authored by hayeswang's avatar hayeswang Committed by David S. Miller
Browse files

r8152: move the actions of saving the information of the device



Some information of the device may be used in other functions. Move
the relative code to make sure it would be initialzed correctly
before using it.

Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 45f4a19f
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -2759,6 +2759,10 @@ static int rtl8152_probe(struct usb_interface *intf,
	tp = netdev_priv(netdev);
	tp = netdev_priv(netdev);
	tp->msg_enable = 0x7FFF;
	tp->msg_enable = 0x7FFF;


	tp->udev = udev;
	tp->netdev = netdev;
	tp->intf = intf;

	if (!rtl_ops_init(tp, id)) {
	if (!rtl_ops_init(tp, id)) {
		netif_err(tp, probe, netdev, "Unknown Device");
		netif_err(tp, probe, netdev, "Unknown Device");
		return -ENODEV;
		return -ENODEV;
@@ -2767,9 +2771,6 @@ static int rtl8152_probe(struct usb_interface *intf,
	tasklet_init(&tp->tl, bottom_half, (unsigned long)tp);
	tasklet_init(&tp->tl, bottom_half, (unsigned long)tp);
	INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t);
	INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t);


	tp->udev = udev;
	tp->netdev = netdev;
	tp->intf = intf;
	netdev->netdev_ops = &rtl8152_netdev_ops;
	netdev->netdev_ops = &rtl8152_netdev_ops;
	netdev->watchdog_timeo = RTL8152_TX_TIMEOUT;
	netdev->watchdog_timeo = RTL8152_TX_TIMEOUT;