From: hayeswang <hayeswang@realtek.com>
Date: Mon, 6 Jan 2014 09:08:42 +0000 (+0800)
Subject: r8152: move the actions of saving the information of the device
X-Git-Tag: firefly_0821_release~176^2~4570^2~274
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e3ad412ad8b0c9994db8518d151bf036e070dfcc;p=firefly-linux-kernel-4.4.55.git

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: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 095f15b56e7c..8615681096b1 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -2759,6 +2759,10 @@ static int rtl8152_probe(struct usb_interface *intf,
 	tp = netdev_priv(netdev);
 	tp->msg_enable = 0x7FFF;
 
+	tp->udev = udev;
+	tp->netdev = netdev;
+	tp->intf = intf;
+
 	if (!rtl_ops_init(tp, id)) {
 		netif_err(tp, probe, netdev, "Unknown Device");
 		return -ENODEV;
@@ -2767,9 +2771,6 @@ static int rtl8152_probe(struct usb_interface *intf,
 	tasklet_init(&tp->tl, bottom_half, (unsigned long)tp);
 	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->watchdog_timeo = RTL8152_TX_TIMEOUT;