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>
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;
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;