Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Pankaj Dubey <pankaj.dubey@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Pankaj Dubey and committed by
Lee Jones
45330bb4 3e87933a

+5 -1
+5 -1
drivers/mfd/syscon.c
··· 94 94 struct device_node *syscon_np; 95 95 struct regmap *regmap; 96 96 97 - syscon_np = of_parse_phandle(np, property, 0); 97 + if (property) 98 + syscon_np = of_parse_phandle(np, property, 0); 99 + else 100 + syscon_np = np; 101 + 98 102 if (!syscon_np) 99 103 return ERR_PTR(-ENODEV); 100 104