* (no subject)
@ 2012-08-10 5:32 devendra.aaru
2012-08-10 8:45 ` Linus Walleij
2012-08-10 10:47 ` Re: Bernd Petrovitsch
0 siblings, 2 replies; 3+ messages in thread
From: devendra.aaru @ 2012-08-10 5:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Linus Walleij
Hi,
In function tegra_pinctrl_dt_node_to_map the num_maps the num_maps
counter must be incremented for each child node?
Actually we are doing free until num_maps if tegra_pinctrl_dt_subnode_to_map,
not only that if num_maps == 0, we wont free up the maps, and also i
think the for_each_of_node checks whether we have a next child node,
so its safe to do num_maps++ as it wont get incremented endlessly,
Please correct me if i am wrong.
Thanks,
diff --git a/drivers/pinctrl/pinctrl-tegra.c b/drivers/pinctrl/pinctrl-tegra.c
index ae52e4e..33ae918 100644
--- a/drivers/pinctrl/pinctrl-tegra.c
+++ b/drivers/pinctrl/pinctrl-tegra.c
@@ -303,6 +303,7 @@ int tegra_pinctrl_dt_node_to_map(struct
pinctrl_dev *pctldev,
*num_maps = 0;
for_each_child_of_node(np_config, np) {
+ num_maps++;
ret = tegra_pinctrl_dt_subnode_to_map(pctldev->dev, np, map,
&reserved_maps, num_maps);
if (ret < 0) {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re:
2012-08-10 5:32 devendra.aaru
@ 2012-08-10 8:45 ` Linus Walleij
2012-08-10 10:47 ` Re: Bernd Petrovitsch
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2012-08-10 8:45 UTC (permalink / raw)
To: devendra.aaru, Stephen Warren; +Cc: linux-kernel
On Fri, Aug 10, 2012 at 7:32 AM, devendra.aaru <devendra.aaru@gmail.com> wrote:
> In function tegra_pinctrl_dt_node_to_map the num_maps the num_maps
> counter must be incremented for each child node?
I need Stephen Warren to comment on this patch...
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re:
2012-08-10 5:32 devendra.aaru
2012-08-10 8:45 ` Linus Walleij
@ 2012-08-10 10:47 ` Bernd Petrovitsch
1 sibling, 0 replies; 3+ messages in thread
From: Bernd Petrovitsch @ 2012-08-10 10:47 UTC (permalink / raw)
To: devendra.aaru; +Cc: linux-kernel, Linus Walleij
Hi!
On Fre, 2012-08-10 at 11:02 +0530, devendra.aaru wrote:
[...]
> In function tegra_pinctrl_dt_node_to_map the num_maps the num_maps
> counter must be incremented for each child node?
>
> Actually we are doing free until num_maps if tegra_pinctrl_dt_subnode_to_map,
>
> not only that if num_maps == 0, we wont free up the maps, and also i
> think the for_each_of_node checks whether we have a next child node,
> so its safe to do num_maps++ as it wont get incremented endlessly,
[...]
Not that I looked into the source but ....
> diff --git a/drivers/pinctrl/pinctrl-tegra.c b/drivers/pinctrl/pinctrl-tegra.c
> index ae52e4e..33ae918 100644
> --- a/drivers/pinctrl/pinctrl-tegra.c
> +++ b/drivers/pinctrl/pinctrl-tegra.c
> @@ -303,6 +303,7 @@ int tegra_pinctrl_dt_node_to_map(struct
> pinctrl_dev *pctldev,
... num_maps appears to be a pointer to the counter here and ...
> *num_maps = 0;
>
> for_each_child_of_node(np_config, np) {
... here you increment the pointer as such and where it points to (which
appears to be the counter).
> + num_maps++;
> ret = tegra_pinctrl_dt_subnode_to_map(pctldev->dev, np, map,
> &reserved_maps, num_maps);
> if (ret < 0) {
Kinf regards,
Bernd
--
Bernd Petrovitsch Email : bernd@petrovitsch.priv.at
LUGA : http://www.luga.at
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-10 10:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-10 5:32 devendra.aaru
2012-08-10 8:45 ` Linus Walleij
2012-08-10 10:47 ` Re: Bernd Petrovitsch
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).