public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
To: "davem@davemloft.net" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"jeffrey.t.kirsher@intel.com" <jeffrey.t.kirsher@intel.com>,
	"intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] igb: allow optionally getting mac address from device tree
Date: Mon, 25 Jun 2018 11:25:13 +0000	[thread overview]
Message-ID: <1529925911.12558.12.camel@toradex.com> (raw)
In-Reply-To: <20180625.170547.658198698048994134.davem@davemloft.net>

Hi David

On Mon, 2018-06-25 at 17:05 +0900, David Miller wrote:
> From: Marcel Ziswiler <marcel@ziswiler.com>
> Date: Mon, 25 Jun 2018 10:00:42 +0200
> 
> > @@ -3122,7 +3124,11 @@ static int igb_probe(struct pci_dev *pdev,
> > const struct pci_device_id *ent)
> >  		break;
> >  	}
> >  
> > -	if (eth_platform_get_mac_address(&pdev->dev, hw-
> > >mac.addr)) {
> > +	/* try to get the MAC address from device tree data */
> > +	iap = of_get_mac_address(pdev->dev.of_node);
> > +	if (iap)
> > +		memcpy(hw->mac.addr, iap, ETH_ALEN);
> 
> This is exactly what eth_platform_get_mac_address() shoule be doing.

Yes, you are absolutely right. That indeed already works just fine given a
proper device tree. Struggling with the device tree part I probably missed
noticing this.

Sorry for the noise and thanks for the tip!

Cheers

Marcel

      reply	other threads:[~2018-06-25 11:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25  8:00 [PATCH] igb: allow optionally getting mac address from device tree Marcel Ziswiler
2018-06-25  8:05 ` David Miller
2018-06-25 11:25   ` Marcel Ziswiler [this message]

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=1529925911.12558.12.camel@toradex.com \
    --to=marcel.ziswiler@toradex.com \
    --cc=davem@davemloft.net \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox