Skip to content

Commit

Permalink
r8152: move the actions of saving the information of the device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hayeswang authored and David S. Miller committed Jan 6, 2014
1 parent 45f4a19 commit e3ad412
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/usb/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit e3ad412

Please sign in to comment.