Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753933AbaAFJJQ (ORCPT ); Mon, 6 Jan 2014 04:09:16 -0500 Received: from rtits2.realtek.com ([60.250.210.242]:42850 "EHLO rtits2.realtek.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753835AbaAFJJN (ORCPT ); Mon, 6 Jan 2014 04:09:13 -0500 X-SpamFilter-By: BOX Solutions SpamTrap 5.39 with qID s0699BQw023428, This message is accepted by code: ctloc85258 From: Hayes Wang To: CC: , , , Hayes Wang Subject: [PATCH net-next v2 2/3] r8152: move the actions of saving the information of the device Date: Mon, 6 Jan 2014 17:08:42 +0800 Message-ID: <1388999323-9059-3-git-send-email-hayeswang@realtek.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1388999323-9059-1-git-send-email-hayeswang@realtek.com> References: <1388990366-8508-1-git-send-email-hayeswang@realtek.com> <1388999323-9059-1-git-send-email-hayeswang@realtek.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.71.44] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/usb/r8152.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 095f15b..8615681 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; -- 1.8.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/