aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorhayeswang <hayeswang@realtek.com>2014-01-06 04:08:42 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-06 16:24:09 -0500
commite3ad412ad8b0c9994db8518d151bf036e070dfcc (patch)
treea0b9719e637ee8b3ba69e9de377261a2b70a87b0 /drivers/net/usb
parent45f4a19f6d0174aff665dad46128960f66cbcfdf (diff)
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>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/r8152.c7
1 files changed, 4 insertions, 3 deletions
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,
2759 tp = netdev_priv(netdev); 2759 tp = netdev_priv(netdev);
2760 tp->msg_enable = 0x7FFF; 2760 tp->msg_enable = 0x7FFF;
2761 2761
2762 tp->udev = udev;
2763 tp->netdev = netdev;
2764 tp->intf = intf;
2765
2762 if (!rtl_ops_init(tp, id)) { 2766 if (!rtl_ops_init(tp, id)) {
2763 netif_err(tp, probe, netdev, "Unknown Device"); 2767 netif_err(tp, probe, netdev, "Unknown Device");
2764 return -ENODEV; 2768 return -ENODEV;
@@ -2767,9 +2771,6 @@ static int rtl8152_probe(struct usb_interface *intf,
2767 tasklet_init(&tp->tl, bottom_half, (unsigned long)tp); 2771 tasklet_init(&tp->tl, bottom_half, (unsigned long)tp);
2768 INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t); 2772 INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t);
2769 2773
2770 tp->udev = udev;
2771 tp->netdev = netdev;
2772 tp->intf = intf;
2773 netdev->netdev_ops = &rtl8152_netdev_ops; 2774 netdev->netdev_ops = &rtl8152_netdev_ops;
2774 netdev->watchdog_timeo = RTL8152_TX_TIMEOUT; 2775 netdev->watchdog_timeo = RTL8152_TX_TIMEOUT;
2775 2776