lkml.org 
[lkml]   [2018]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] igb: allow optionally getting mac address from device tree
Date
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
\
 
 \ /
  Last update: 2018-06-25 13:25    [W:0.037 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site