* [PATCH] mfd: syscon: allow property as NULL in syscon_regmap_lookup_by_phandle
@ 2014-04-30 2:14 Pankaj Dubey
2014-04-30 14:07 ` Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Pankaj Dubey @ 2014-04-30 2:14 UTC (permalink / raw)
To: linux-kernel; +Cc: sameo, lee.jones, Pankaj Dubey
If we pass syscon device node itself as first parameter to this function
there is no need to parse and find syscon device node. So by allowing
"property" parameter as NULL allow syscon_regmap_lookup_by_phandle to
consider passed argument "np" itself as a syscon device node "syscon_np".
This will help us in avoiding addition of "syscon" property in a device node
which points back to same device node in device tree.
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
drivers/mfd/syscon.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index dbea55d..b30f941 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -94,7 +94,11 @@ struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np,
struct device_node *syscon_np;
struct regmap *regmap;
- syscon_np = of_parse_phandle(np, property, 0);
+ if (property)
+ syscon_np = of_parse_phandle(np, property, 0);
+ else
+ syscon_np = np;
+
if (!syscon_np)
return ERR_PTR(-ENODEV);
--
1.7.10.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mfd: syscon: allow property as NULL in syscon_regmap_lookup_by_phandle
2014-04-30 2:14 [PATCH] mfd: syscon: allow property as NULL in syscon_regmap_lookup_by_phandle Pankaj Dubey
@ 2014-04-30 14:07 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2014-04-30 14:07 UTC (permalink / raw)
To: Pankaj Dubey; +Cc: linux-kernel, sameo
> If we pass syscon device node itself as first parameter to this function
> there is no need to parse and find syscon device node. So by allowing
> "property" parameter as NULL allow syscon_regmap_lookup_by_phandle to
> consider passed argument "np" itself as a syscon device node "syscon_np".
> This will help us in avoiding addition of "syscon" property in a device node
> which points back to same device node in device tree.
>
> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
> ---
> drivers/mfd/syscon.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
Seems reasonable. Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-30 14:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-30 2:14 [PATCH] mfd: syscon: allow property as NULL in syscon_regmap_lookup_by_phandle Pankaj Dubey
2014-04-30 14:07 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®