[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ+vNU1-LFxC+fNiwO+Jiyzp0PZMM7h4xA2wYCrgasY9vXg5aA@mail.gmail.com>
Date: Wed, 5 Mar 2014 07:38:01 -0800
From: Tim Harvey <tharvey@...eworks.com>
To: Rob Herring <robherring2@...il.com>
Cc: Stephen Hemminger <stephen@...workplumber.org>,
netdev <netdev@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Grant Likely <grant.likely@...aro.org>,
Rob Herring <robh+dt@...nel.org>
Subject: Re: [PATCH] net: sky2: allow mac to come from dt
On Tue, Mar 4, 2014 at 10:32 PM, Rob Herring <robherring2@...il.com> wrote:
<snip>
>> @@ -4805,8 +4808,27 @@ static struct net_device *sky2_init_netdev(struct sky2_hw *hw, unsigned port,
>>
>> dev->features |= dev->hw_features;
>>
>> + /* try to get mac address in the following order:
>> + * 1) from device tree data
>> + * 2) from internal registers set by bootloader
>> + */
>> + iap = NULL;
>> + if (IS_ENABLED(CONFIG_OF)) {
>
> This shouldn't be needed.
>
>> + struct device_node *np = hw->pdev->dev.of_node;
>> + if (np)
>> + iap = (unsigned char *) of_get_mac_address(np);
>> + }
>
> This should all just be 1 line. of_get_mac_address should just return
> NULL if !CONFIG_OF or np == NULL.
agreed - I verified this is true
>
>> +
>> + /* 2) mac registers set by bootloader
>> + */
>> + if (!iap || !is_valid_ether_addr(iap)) {
>
> Perhaps is_valid_ether_addr check should also be moved into of_get_mac_address.
>
looks like it already does that - I'll simplify the above
> Rob
Thanks for the review!
Tim
--
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