From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Sudeep Holla <sudeep.holla@arm.com>,
linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
devicetree@vger.kernel.org, linux-sh@vger.kernel.org,
linux-renesas-soc@vger.kernel.org,
Rob Herring <robh+dt@kernel.org>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [RFC PATCH] of: base: add support to get machine model name
Date: Thu, 17 Nov 2016 14:50:13 +0100 [thread overview]
Message-ID: <3670336.mMHByOpDl4@wuerfel> (raw)
In-Reply-To: <1479383450-19183-1-git-send-email-sudeep.holla@arm.com>
On Thursday, November 17, 2016 11:50:50 AM CET Sudeep Holla wrote:
> Currently platforms/drivers needing to get the machine model name are
> replicating the same snippet of code. In some case, the OF reference
> counting is either missing or incorrect.
>
> This patch adds support to read the machine model name either using
> the "model" or the "compatible" property in the device tree root node.
>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
I like the idea. One small comment:
> +int of_machine_get_model_name(const char **model)
> +{
> + int error;
> + struct device_node *root;
> +
> + root = of_find_node_by_path("/");
> + if (!root)
> + return -EINVAL;
The global of_root variable points ot this already, and is defined
in the same file, so I think we can just skip the lookup.
Arnd
next prev parent reply other threads:[~2016-11-17 13:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-17 11:50 [RFC PATCH] of: base: add support to get machine model name Sudeep Holla
2016-11-17 13:50 ` Arnd Bergmann [this message]
2016-11-17 14:08 ` Sudeep Holla
2016-11-17 14:13 ` Arnd Bergmann
2016-11-17 14:16 ` Sudeep Holla
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=3670336.mMHByOpDl4@wuerfel \
--to=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=robh+dt@kernel.org \
--cc=sudeep.holla@arm.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).