From: Jeremy Linton <jeremy.linton@arm.com>
To: Robin Murphy <Robin.Murphy@arm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Cc: "steve.glendinning@shawell.net" <steve.glendinning@shawell.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"rafael.j.wysocki@intel.com" <rafael.j.wysocki@intel.com>,
"suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>,
Catalin Marinas <Catalin.Marinas@arm.com>,
"grant.likely@linaro.org" <grant.likely@linaro.org>
Subject: Re: [PATCH 1/2] Add a matching set of device_ functions for determining mac/phy
Date: Thu, 13 Aug 2015 09:24:23 -0500 [thread overview]
Message-ID: <55CCA897.5080108@arm.com> (raw)
In-Reply-To: <55CC8613.1040709@arm.com>
Hello Robin,
On 08/13/2015 06:57 AM, Robin Murphy wrote:
>> +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;
>> +}
>
> Not sure I understand the logic here - "return the same thing we were
> given if we updated it, or null if we didn't". It's only indicating
> success/failure (the caller can perfectly well cast its own buffer to a
> void * if it needs to), so why wouldn't you just return a normal int
> error code?
No particular reason, other than initially I was trying to keep the
function as similar as possible to the one in of_net. AKA copy paste
job. I can convert the return types, but I was trying for a simple
function rename. That way the users of the of version could be converted
with relative ease, and the drivers which invented their own version of
these functions could be changed to use this instead. Of course, that
plan took a blow, when I added the addr/alen parameters.
Same thing applies for the other function.
next prev parent reply other threads:[~2015-08-13 14:24 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-12 22:06 [PATCH 0/2] Enable smsc911x for use with ACPI Jeremy Linton
2015-08-12 22:06 ` [PATCH 1/2] Add a matching set of device_ functions for determining mac/phy Jeremy Linton
2015-08-12 22:13 ` Florian Fainelli
2015-08-14 15:55 ` Jeremy Linton
2015-08-13 11:57 ` Robin Murphy
2015-08-13 14:24 ` Jeremy Linton [this message]
2015-08-12 22:06 ` [PATCH 2/2] Convert smsc911x to use ACPI as well as DT Jeremy Linton
2015-08-13 8:27 ` Graeme Gregory
2015-08-13 9:01 ` Lorenzo Pieralisi
2015-08-13 9:38 ` Graeme Gregory
2015-08-13 10:30 ` Lorenzo Pieralisi
2015-09-09 16:10 ` Marc Zyngier
2015-09-23 17:22 ` Jeremy Linton
2015-09-23 17:46 ` Marc Zyngier
2015-09-23 17:57 ` Sudeep Holla
2015-09-24 9:20 ` Catalin Marinas
2015-11-02 15:48 ` Jeremy Linton
2015-09-23 18:41 ` David Woodhouse
2015-09-23 20:51 ` Rafael J. Wysocki
2015-09-23 21:03 ` David Woodhouse
2015-09-23 23:56 ` Hanjun Guo
2015-09-24 8:16 ` David Woodhouse
2015-09-24 10:31 ` Catalin Marinas
2015-09-24 11:52 ` David Woodhouse
2015-09-24 14:01 ` Lorenzo Pieralisi
2015-09-24 14:31 ` David Woodhouse
2015-09-24 15:15 ` Catalin Marinas
2015-09-24 18:10 ` David Woodhouse
2015-09-25 15:28 ` Catalin Marinas
2015-09-26 2:16 ` Rafael J. Wysocki
2015-09-26 15:20 ` David Woodhouse
2015-10-01 2:23 ` Al Stone
2015-10-06 0:20 ` Charles Garcia-Tobin
2015-10-06 11:08 ` David Woodhouse
2015-10-08 0:11 ` Rafael J. Wysocki
2015-08-14 0:00 ` [PATCH 0/2] Enable smsc911x for use with ACPI David Miller
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=55CCA897.5080108@arm.com \
--to=jeremy.linton@arm.com \
--cc=Catalin.Marinas@arm.com \
--cc=Robin.Murphy@arm.com \
--cc=grant.likely@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=steve.glendinning@shawell.net \
--cc=suravee.suthikulpanit@amd.com \
/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;
as well as URLs for NNTP newsgroup(s).