提交 45330bb4 编写于 作者: P Pankaj Dubey 提交者: Lee Jones

mfd: syscon: Allow property as NULL in syscon_regmap_lookup_by_phandle

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: NPankaj Dubey <pankaj.dubey@samsung.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 3e87933a
...@@ -94,7 +94,11 @@ struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np, ...@@ -94,7 +94,11 @@ struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np,
struct device_node *syscon_np; struct device_node *syscon_np;
struct regmap *regmap; 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) if (!syscon_np)
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册