From: Mark Rutland <mark.rutland@arm.com>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
"grant.likely@linaro.org" <grant.likely@linaro.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Pawel Moll <Pawel.Moll@arm.com>,
Ian Campbell <ian.campbell@citrix.com>,
Kumar Gala <galak@kernel.crashing.org>,
Stephen Warren <swarren@nvidia.com>
Subject: Re: [PATCH V5 2/6] of: move of_parse_phandle()
Date: Wed, 14 Aug 2013 17:05:43 +0100 [thread overview]
Message-ID: <20130814160543.GC18868@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <1376328992-3115-2-git-send-email-swarren@wwwdotorg.org>
On Mon, Aug 12, 2013 at 06:36:28PM +0100, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Move of_parse_phandle() after __of_parse_phandle_with_args(), since a
> future patch will call __of_parse_phandle_with_args() from
> of_parse_phandle(). Moving the function avoids adding a prototype. Doing
> the move separately highlights the code changes separately.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
> ---
> v5: New patch.
> ---
> drivers/of/base.c | 48 ++++++++++++++++++++++++------------------------
> 1 file changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 23e7073..b9e77ec 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1080,30 +1080,6 @@ int of_property_count_strings(struct device_node *np, const char *propname)
> }
> EXPORT_SYMBOL_GPL(of_property_count_strings);
>
> -/**
> - * of_parse_phandle - Resolve a phandle property to a device_node pointer
> - * @np: Pointer to device node holding phandle property
> - * @phandle_name: Name of property holding a phandle value
> - * @index: For properties holding a table of phandles, this is the index into
> - * the table
> - *
> - * Returns the device_node pointer with refcount incremented. Use
> - * of_node_put() on it when done.
> - */
> -struct device_node *of_parse_phandle(const struct device_node *np,
> - const char *phandle_name, int index)
> -{
> - const __be32 *phandle;
> - int size;
> -
> - phandle = of_get_property(np, phandle_name, &size);
> - if ((!phandle) || (size < sizeof(*phandle) * (index + 1)))
> - return NULL;
> -
> - return of_find_node_by_phandle(be32_to_cpup(phandle + index));
> -}
> -EXPORT_SYMBOL(of_parse_phandle);
> -
> static int __of_parse_phandle_with_args(const struct device_node *np,
> const char *list_name,
> const char *cells_name, int index,
> @@ -1207,6 +1183,30 @@ static int __of_parse_phandle_with_args(const struct device_node *np,
> }
>
> /**
> + * of_parse_phandle - Resolve a phandle property to a device_node pointer
> + * @np: Pointer to device node holding phandle property
> + * @phandle_name: Name of property holding a phandle value
> + * @index: For properties holding a table of phandles, this is the index into
> + * the table
> + *
> + * Returns the device_node pointer with refcount incremented. Use
> + * of_node_put() on it when done.
> + */
> +struct device_node *of_parse_phandle(const struct device_node *np,
> + const char *phandle_name, int index)
> +{
> + const __be32 *phandle;
> + int size;
> +
> + phandle = of_get_property(np, phandle_name, &size);
> + if ((!phandle) || (size < sizeof(*phandle) * (index + 1)))
> + return NULL;
> +
> + return of_find_node_by_phandle(be32_to_cpup(phandle + index));
> +}
> +EXPORT_SYMBOL(of_parse_phandle);
> +
> +/**
> * of_parse_phandle_with_args() - Find a node pointed by phandle in a list
> * @np: pointer to a device tree node containing a list
> * @list_name: property name that contains a list
> --
> 1.8.1.5
>
>
next prev parent reply other threads:[~2013-08-14 16:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-12 17:36 [PATCH V5 1/6] of: move documentation of of_parse_phandle_with_args Stephen Warren
2013-08-12 17:36 ` [PATCH V5 2/6] of: move of_parse_phandle() Stephen Warren
2013-08-14 16:05 ` Mark Rutland [this message]
2013-08-12 17:36 ` [PATCH V5 3/6] of: introduce of_parse_phandle_with_fixed_args Stephen Warren
2013-08-12 17:36 ` [PATCH V5 4/6] of: call __of_parse_phandle_with_args from of_parse_phandle Stephen Warren
2013-08-13 9:08 ` Mark Rutland
2013-08-13 15:54 ` Stephen Warren
2013-08-13 16:29 ` Mark Rutland
2013-08-13 18:12 ` Stephen Warren
2013-08-14 16:04 ` Mark Rutland
2013-08-12 17:36 ` [PATCH V5 5/6] gpio: clean up gpio-ranges documentation Stephen Warren
2013-08-12 17:36 ` [PATCH V5 6/6] gpio: implement gpio-ranges binding document fix Stephen Warren
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=20130814160543.GC18868@e106331-lin.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=Pawel.Moll@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@kernel.crashing.org \
--cc=grant.likely@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=swarren@nvidia.com \
--cc=swarren@wwwdotorg.org \
/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).