All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] ARM: LPC32xx: Ethernet driver
Date: Tue, 28 Feb 2012 13:41:01 +0000	[thread overview]
Message-ID: <201202281341.01690.arnd@arndb.de> (raw)
In-Reply-To: <4F4CD781.2090802@antcom.de>

On Tuesday 28 February 2012, Roland Stigge wrote:
> Yes, that's why we previously had a cmdline param for it (but removed it
> upon request from the netdev maintainer).
> 
> So if the hardware defaults to 00:00:00:00:00:00, what is the
> "consistent policy we want to enforce in all drivers"?
> 
> A link or hint would be sufficient.

I think the most common strategy for platform drivers these days is

1. use what the hardware provides
2. call of_get_mac_address(dev->of_node, ...)
3. use random_ether_addr

in that order. of_get_mac_address just returns NULL when there
is no device tree or no local-mac-address property, so you can
put it into the driver right away.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Roland Stigge <stigge@antcom.de>
Cc: David Laight <David.Laight@aculab.com>,
	baruch@tkos.co.il, alexander.h.duyck@intel.com,
	ian.campbell@citrix.com, netdev@vger.kernel.org,
	eilong@broadcom.com, Kevin Wells <kevin.wells@nxp.com>,
	Wolfram Sang <w.sang@pengutronix.de>,
	jeffrey.t.kirsher@intel.com, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] ARM: LPC32xx: Ethernet driver
Date: Tue, 28 Feb 2012 13:41:01 +0000	[thread overview]
Message-ID: <201202281341.01690.arnd@arndb.de> (raw)
In-Reply-To: <4F4CD781.2090802@antcom.de>

On Tuesday 28 February 2012, Roland Stigge wrote:
> Yes, that's why we previously had a cmdline param for it (but removed it
> upon request from the netdev maintainer).
> 
> So if the hardware defaults to 00:00:00:00:00:00, what is the
> "consistent policy we want to enforce in all drivers"?
> 
> A link or hint would be sufficient.

I think the most common strategy for platform drivers these days is

1. use what the hardware provides
2. call of_get_mac_address(dev->of_node, ...)
3. use random_ether_addr

in that order. of_get_mac_address just returns NULL when there
is no device tree or no local-mac-address property, so you can
put it into the driver right away.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Roland Stigge <stigge@antcom.de>
Cc: alexander.h.duyck@intel.com, baruch@tkos.co.il,
	ian.campbell@citrix.com, netdev@vger.kernel.org,
	eilong@broadcom.com, Kevin Wells <kevin.wells@nxp.com>,
	Wolfram Sang <w.sang@pengutronix.de>,
	David Laight <David.Laight@aculab.com>,
	jeffrey.t.kirsher@intel.com, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] ARM: LPC32xx: Ethernet driver
Date: Tue, 28 Feb 2012 13:41:01 +0000	[thread overview]
Message-ID: <201202281341.01690.arnd@arndb.de> (raw)
In-Reply-To: <4F4CD781.2090802@antcom.de>

On Tuesday 28 February 2012, Roland Stigge wrote:
> Yes, that's why we previously had a cmdline param for it (but removed it
> upon request from the netdev maintainer).
> 
> So if the hardware defaults to 00:00:00:00:00:00, what is the
> "consistent policy we want to enforce in all drivers"?
> 
> A link or hint would be sufficient.

I think the most common strategy for platform drivers these days is

1. use what the hardware provides
2. call of_get_mac_address(dev->of_node, ...)
3. use random_ether_addr

in that order. of_get_mac_address just returns NULL when there
is no device tree or no local-mac-address property, so you can
put it into the driver right away.

	Arnd

  reply	other threads:[~2012-02-28 13:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-28 13:08 [PATCH v2] ARM: LPC32xx: Ethernet driver Roland Stigge
2012-02-28 13:11 ` David Laight
2012-02-28 13:11   ` David Laight
2012-02-28 13:32   ` Roland Stigge
2012-02-28 13:32     ` Roland Stigge
2012-02-28 13:41     ` Arnd Bergmann [this message]
2012-02-28 13:41       ` Arnd Bergmann
2012-02-28 13:41       ` Arnd Bergmann
2012-02-28 13:49       ` Roland Stigge
2012-02-28 13:49         ` Roland Stigge
2012-02-28 15:53       ` Ben Hutchings
2012-02-28 15:53         ` Ben Hutchings
2012-02-28 19:13 ` David Miller
2012-02-28 19:13   ` David Miller
2012-02-28 19:13   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2012-02-25 20:21 Roland Stigge
2012-02-25 20:21 ` Roland Stigge
2012-02-25 20:41 ` Joe Perches
2012-02-25 20:41   ` Joe Perches
2012-02-26  1:52 ` Baruch Siach
2012-02-26  1:52   ` Baruch Siach
2012-02-26  2:28   ` David Miller
2012-02-26  2:28     ` David Miller
2012-02-26  2:28     ` 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=201202281341.01690.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.