netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hayes Wang <hayeswang@realtek.com>
To: <netdev@vger.kernel.org>
Cc: <nic_swsd@realtek.com>, <linux-kernel@vger.kernel.org>,
	<linux-usb@vger.kernel.org>, Hayes Wang <hayeswang@realtek.com>
Subject: [PATCH net-next 2/3] r8152: move the actions of saving the information of the device
Date: Mon, 6 Jan 2014 14:39:25 +0800	[thread overview]
Message-ID: <1388990366-8508-3-git-send-email-hayeswang@realtek.com> (raw)
In-Reply-To: <1388990366-8508-1-git-send-email-hayeswang@realtek.com>

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

  parent reply	other threads:[~2014-01-06  6:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06  6:39 [PATCH net-next 0/3] adjust the code of r8152 Hayes Wang
2014-01-06  6:39 ` [PATCH net-next 1/3] r8152: replace some tabs with spaces Hayes Wang
2014-01-06  6:39 ` Hayes Wang [this message]
     [not found] ` <1388990366-8508-1-git-send-email-hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
2014-01-06  6:39   ` [PATCH net-next 3/3] r8152: replace the return value of rtl_ops_init Hayes Wang
2014-01-06  6:59     ` Joe Perches
2014-01-06  9:08 ` [PATCH net-next v2 0/3] adjust the code of r8152 Hayes Wang
2014-01-06  9:08   ` [PATCH net-next v2 1/3] r8152: replace some tabs with spaces Hayes Wang
2014-01-06  9:08   ` [PATCH net-next v2 2/3] r8152: move the actions of saving the information of the device Hayes Wang
2014-01-06  9:08   ` [PATCH net-next v2 3/3] r8152: replace the return value of rtl_ops_init Hayes Wang
2014-01-06 21:15   ` [PATCH net-next v2 0/3] adjust the code of r8152 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1388990366-8508-3-git-send-email-hayeswang@realtek.com \
    --to=hayeswang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).