public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] net: fix handling of 'ethrotate' environment variable
Date: Wed, 16 Jan 2008 12:32:51 +0100	[thread overview]
Message-ID: <200801161232.51971.matthias.fuchs@esd-electronics.com> (raw)

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
---
 net/eth.c |    9 +++++++++
 net/net.c |    9 +--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/net/eth.c b/net/eth.c
index 5d9e9c1..d55fd7e 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -522,6 +522,15 @@ int eth_receive(volatile void *packet, int length)
 void eth_try_another(int first_restart)
 {
 	static struct eth_device *first_failed = NULL;
+	char *ethrotate;
+
+	/*
+	 * Do not rotate between network interfaces when
+	 * 'ethrotate' variable is set to 'no'.
+	 */
+	if (((ethrotate = getenv ("ethrotate")) != NULL) &&
+	    (strcmp(ethrotate, "no") == 0))
+		return;
 
 	if (!eth_current)
 		return;
diff --git a/net/net.c b/net/net.c
index e1b71a9..522c54d 100644
--- a/net/net.c
+++ b/net/net.c
@@ -581,7 +581,6 @@ void NetStartAgain (void)
 {
 	char *nretry;
 	int noretry = 0, once = 0;
-	char *ethrotate;
 
 	if ((nretry = getenv ("netretry")) != NULL) {
 		noretry = (strcmp (nretry, "no") == 0);
@@ -598,13 +597,7 @@ void NetStartAgain (void)
 #else	/* !CONFIG_NET_MULTI*/
 	eth_halt ();
 
-	/*
-	 * Do not rotate between network interfaces when
-	 * 'ethrotate' variable is set to 'no'.
-	 */
-	if (((ethrotate = getenv ("ethrotate")) == NULL) ||
-	    (strcmp(ethrotate, "no") != 0))
-		eth_try_another (!NetRestarted);
+	eth_try_another (!NetRestarted);
 
 	eth_init (gd->bd);
 	if (NetRestartWrap) {
-- 
1.5.3

             reply	other threads:[~2008-01-16 11:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-16 11:32 Matthias Fuchs [this message]
2008-01-16 22:35 ` [U-Boot-Users] [PATCH] net: fix handling of 'ethrotate' environment variable Ben Warren
2008-01-17  6:45   ` [U-Boot-Users] [PATCH V2] net: add " Matthias Fuchs
2008-01-17 14:48     ` Ben Warren

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=200801161232.51971.matthias.fuchs@esd-electronics.com \
    --to=matthias.fuchs@esd-electronics.com \
    --cc=u-boot@lists.denx.de \
    /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