public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/6] net: usbeth: remove misleading warning
Date: Wed, 22 Aug 2012 20:32:10 +0200	[thread overview]
Message-ID: <1345660330.11163.22.camel@selen> (raw)
In-Reply-To: <201208222022.49653.marex@denx.de>

Am Mittwoch, den 22.08.2012, 20:22 +0200 schrieb Marek Vasut:
> Dear Lucas Stach,
> 
> > If the environment doesn't provide a MAC address it's not an
> > error to use the one provided by the eth adapter. Actually it
> > should be the default case if the adapter exports it's own
> > address during get_info().
> 
> I think we should warn if the addr in env doesn't match the one in the device. 
> Otherwise, if the env doesn't contain ethaddr (or eth1addr, eth2addr ...), pull 
> one from the device and inform user.
> 
Sadly it's not obvious from the diff context, but the warning if MAC in
env does not match the one from the device is just above this hunk. Joe
explained to me that the ueth core should always pull the address from
the device and if this succeeds it always sets this address back if none
is found in env. As this is the default case (and we are not actually
changing the MAC of the device) there is no point in bothering the user
with this info.

This is the whole point of this patch. That no one has seen this warning
with the current code is simply because no usb eth driver had
implemented the mac fetch at the right spot. ASIX now does this.

> > So just remove the warning that gets printed in this case.
> > 
> > Signed-off-by: Lucas Stach <dev@lynxeye.de>
> > ---
> >  net/eth.c | 2 --
> >  1 Datei ge?ndert, 2 Zeilen entfernt(-)
> > 
> > diff --git a/net/eth.c b/net/eth.c
> > index 1a11ce1..39cd5da 100644
> > --- a/net/eth.c
> > +++ b/net/eth.c
> > @@ -217,8 +217,6 @@ int eth_write_hwaddr(struct eth_device *dev, const char
> > *base_name, } else if (is_valid_ether_addr(dev->enetaddr)) {
> >  		eth_setenv_enetaddr_by_index(base_name, eth_number,
> >  					     dev->enetaddr);
> > -		printf("\nWarning: %s using MAC address from net device\n",
> > -			dev->name);
> >  	}
> > 
> >  	if (dev->write_hwaddr &&
> 
> Best regards,
> Marek Vasut
> 

  reply	other threads:[~2012-08-22 18:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 10:09 [U-Boot] [PATCH 0/6] net: ASIX AX88772B enablement Lucas Stach
2012-08-22 10:09 ` [U-Boot] [PATCH 1/6] net: introduce transparent driver private in ueth_data Lucas Stach
2012-08-22 18:21   ` Marek Vasut
2012-08-22 18:49   ` Joe Hershberger
2012-08-22 10:09 ` [U-Boot] [PATCH 2/6] net: usbeth: remove misleading warning Lucas Stach
2012-08-22 18:22   ` Marek Vasut
2012-08-22 18:32     ` Lucas Stach [this message]
2012-08-22 18:46       ` Joe Hershberger
2012-08-22 10:09 ` [U-Boot] [PATCH 3/6] net: asix: split out basic reset function Lucas Stach
2012-08-22 18:23   ` Marek Vasut
2012-08-22 18:52   ` Joe Hershberger
2012-08-23  3:01   ` Mike Frysinger
2012-08-23  8:37     ` Lucas Stach
2012-08-22 10:09 ` [U-Boot] [PATCH 4/6] net: asix: add write_hwaddr function Lucas Stach
2012-08-22 18:25   ` Marek Vasut
2012-08-22 19:04   ` Joe Hershberger
2012-08-22 10:09 ` [U-Boot] [PATCH 5/6] net: asix: add read_mac function Lucas Stach
2012-08-22 18:26   ` Marek Vasut
2012-08-22 18:59   ` Joe Hershberger
2012-08-22 10:09 ` [U-Boot] [PATCH 6/6] net: asix: add AX88772B support Lucas Stach
2012-08-22 18:26   ` Marek Vasut
2012-08-22 19:01   ` Joe Hershberger
2012-08-22 18:20 ` [U-Boot] [PATCH 0/6] net: ASIX AX88772B enablement Marek Vasut

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=1345660330.11163.22.camel@selen \
    --to=dev@lynxeye.de \
    --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