aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Miao <eric.miao@linaro.org>2011-08-16 19:33:44 +0000
committerJohn Rigby <john.rigby@linaro.org>2011-12-18 21:28:50 -0700
commitcc13f8d8c50a4a956ab89da5fa186d8fb97706b3 (patch)
treeec5b139e3fdf65dda09393f510f1253b9f0143a0
parenta87eaba43065d9f0eb504c19a608d00e71e02b33 (diff)
net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back
Ignore the return value of eth_getenv_enetaddr_by_index(), and if it fails, fall back to use dev->enetaddr, which could be filled up by the ethernet device driver. Actually, this is the original behavior, and was later changed by commit 48506a2cde2458fa1f8c5993afc98e5a4617e1d3. Signed-off-by: Eric Miao <eric.miao@linaro.org> Acked-by: Simon Glass <sjg@chromium.org>
-rw-r--r--net/eth.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/eth.c b/net/eth.c
index 4280d6dbe..7f0a94ffc 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -190,8 +190,7 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
unsigned char env_enetaddr[6];
int ret = 0;
- if (!eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr))
- return -1;
+ eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr);
if (memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) {
if (memcmp(dev->enetaddr, "\0\0\0\0\0\0", 6) &&