From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Thu, 12 Jan 2012 08:48:07 +0100 Subject: [U-Boot] [PATCH] net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back In-Reply-To: References: <1313559224-4627-1-git-send-email-eric.miao@linaro.org> <4F0D7F59.9030009@de.bosch.com> Message-ID: <201201120848.07269.sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thursday 12 January 2012 06:12:19 Simon Glass wrote: > On Wed, Jan 11, 2012 at 4:23 AM, Dirk Behme wrote: > > On 17.08.2011 08:22, Simon Glass wrote: > >> On Tue, Aug 16, 2011 at 10:33 PM, Eric Miao wrote: > >>> 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 > >> > >> Hi Eric, > >> > >> I found this in u-boot-usb although the commit hash I saw was 7616e7850. > >> > >>> --- > >>> net/eth.c | 3 +-- > >>> 1 files changed, 1 insertions(+), 2 deletions(-) > >>> > >>> diff --git a/net/eth.c b/net/eth.c > >>> index a34fe59..c4fbe11 100644 > >>> --- a/net/eth.c > >>> +++ b/net/eth.c > >>> @@ -195,8 +195,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) && > >> > >> Acked-by: Simon Glass > > > > Ping. > > > > Anybody likes to apply this? Or any new comments? > > > > Many thanks and best regards > > > > Dirk > > > > P.S.: I add Wolfgang as he seems to have done the last commits to > > net/eth.c. > > Maybe Stefan might pick it up through the staging tree? Okay, let's take a look... Best regards, Stefan -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de