From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756927AbcBCPmO (ORCPT ); Wed, 3 Feb 2016 10:42:14 -0500 Received: from shell.v3.sk ([92.60.52.57]:34192 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756155AbcBCPmM convert rfc822-to-8bit (ORCPT ); Wed, 3 Feb 2016 10:42:12 -0500 Message-ID: <1454514122.25750.6.camel@v3.sk> Subject: Re: [PATCH 1/2] net/smscx5xx: use the device tree for mac address From: Lubomir Rintel To: Arnd Bergmann Cc: linux-rpi-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Anholt , Lee Jones , Stephen Warren , Peter Chen Date: Wed, 03 Feb 2016 16:42:02 +0100 In-Reply-To: <2240729.oauKHqo53h@wuerfel> References: <1454511759-24827-1-git-send-email-lkundrak@v3.sk> <1454511759-24827-2-git-send-email-lkundrak@v3.sk> <2240729.oauKHqo53h@wuerfel> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.3 (3.18.3-1.fc23) Mime-Version: 1.0 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2016-02-03 at 16:23 +0100, Arnd Bergmann wrote: > On Wednesday 03 February 2016 16:02:38 Lubomir Rintel wrote: > > From: Arnd Bergmann > > > > This takes the MAC address for smsc75xx/smsc95xx USB network > > devices > > from a the device tree. This is required to get a usable persistent > > address on the popular beagleboard, whose hardware designers > > accidentally forgot that an ethernet device really requires an a > > MAC address to be functional. > > > > The smsc75xx and smsc95xx drivers are just two copies of the > > same code, so better fix both. > > > > Tested-by: Lubomir Rintel > > Signed-off-by: Arnd Bergmann > > > > I have no memory of writing this patch, where did you find it? 2011's discussion: https://lkml.org/lkml/2011/3/17/416 (Link also in the cover letter). > The changelog sounds like I wrote it, so I assume it was me after > all. > > > +       address = of_get_property(dev->udev->dev.of_node, > > +                                 "local-mac-address", NULL); > > +       if (address) { > > +               memcpy(dev->net->dev_addr, address, ETH_ALEN); > > +               return; > > +       } > > This should use of_get_mac_address(), not an open-coded property > lookup. The function was probably added after I wrote the > the original patch. Okay. Will fix that up once I get feedback for the devicetree part. > Arnd Thanks, Lubo