[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55CBC524.4070101@gmail.com>
Date: Wed, 12 Aug 2015 15:13:56 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Jeremy Linton <jeremy.linton@....com>,
linux-arm-kernel@...ts.infradead.org
CC: steve.glendinning@...well.net, netdev@...r.kernel.org,
rafael.j.wysocki@...el.com, Suravee.Suthikulpanit@....com,
Catalin.Marinas@....com, grant.likely@...aro.org
Subject: Re: [PATCH 1/2] Add a matching set of device_ functions for determining
mac/phy
On 12/08/15 15:06, Jeremy Linton wrote:
> OF has some helper functions for parsing MAC and PHY settings.
> In cases where the platform is providing this information rather
> than the device itself, there needs to be similar functions for ACPI.
>
> These functions are slightly modified versions of the ones in
> of_net which can use information provided via DT or ACPI.
>
> Signed-off-by: Jeremy Linton <jeremy.linton@....com>
> ---
[snip]
> +
> +static void *device_get_mac_addr(struct device *dev,
> + const char *name, char *addr,
> + int alen)
> +{
> + int ret = device_property_read_u8_array(dev, name, addr, alen);
> +
> + if (ret == 0 && is_valid_ether_addr(addr))
> + return addr;
> + return NULL;
The DT counterpart has an additional check on the properly length to be
ETH_ALEN, you might want to have such check here for consistency and
correctness.
Other than that, this looks good to me.
--
Florian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists