From: David Miller <davem@davemloft.net>
To: joe@perches.com
Cc: bjorn@mork.no, netdev@vger.kernel.org, sowmini.varadhan@oracle.com
Subject: Re: [PATCH v2] net: Add eth_platform_get_mac_address() helper.
Date: Wed, 06 Jan 2016 19:01:07 -0500 (EST) [thread overview]
Message-ID: <20160106.190107.1969093816791419629.davem@davemloft.net> (raw)
In-Reply-To: <1452123144.24575.57.camel@perches.com>
From: Joe Perches <joe@perches.com>
Date: Wed, 06 Jan 2016 15:32:24 -0800
> On Thu, 2016-01-07 at 00:26 +0100, Bjørn Mork wrote:
>> Joe Perches <joe@perches.com> writes:
>> > On Wed, 2016-01-06 at 16:33 -0500, David Miller wrote:
>> > > A repeating pattern in drivers has become to use OF node information
>> > > and, if not found, platform specific host information to extract the
>> > > ethernet address for a given device.
>> > []
>> > > diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
>> > []
>> > > @@ -485,3 +487,32 @@ static int __init eth_offload_init(void)
>> > > }
>> > >
>> > > fs_initcall(eth_offload_init);
>> > > +
>> > > +unsigned char * __weak arch_get_platform_mac_address(void)
>> > > +{
>> > > + return NULL;
>> >
>> > WARN_ON_ONCE ?
>>
>> That would prevent a driver from using this with additional fallback
>> methods. For what reason?
>
> It's declared __weak and should be overridden by
> an arch specific function.
>
> A NULL address would cause a fault when using
> a function like copy_ether_addr.
The caller checks for NULL, and this is the default implementation
doing precisely what it is meant to do.
next prev parent reply other threads:[~2016-01-07 0:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 21:33 [PATCH v2] net: Add eth_platform_get_mac_address() helper David Miller
2016-01-06 21:45 ` Sowmini Varadhan
2016-01-06 23:12 ` Joe Perches
2016-01-06 23:26 ` Bjørn Mork
2016-01-06 23:32 ` Joe Perches
2016-01-06 23:41 ` Bjørn Mork
2016-01-07 0:01 ` David Miller [this message]
2016-01-07 0:02 ` Joe Perches
2016-01-13 0:49 ` Sowmini Varadhan
2016-01-13 0:59 ` Kirsher, Jeffrey T
2016-01-13 2:40 ` 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=20160106.190107.1969093816791419629.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bjorn@mork.no \
--cc=joe@perches.com \
--cc=netdev@vger.kernel.org \
--cc=sowmini.varadhan@oracle.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).