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

regulator: mc13xxx: Fix probing with DT

The nodes of regulators should be retrieved from parent device.
Bug was be introduced by commit (regulator: mc13xxx: Fix NULL
pointer error in non-DT mode) in conjuction with (mfd: Revert
"mfd: Always assign of_node in mfd_add_device()").

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@linaro.org>

authored by

Alexander Shiyan and committed by
Mark Brown
b431e69a bf7f882b

+4 -4
+4 -4
drivers/regulator/mc13xxx-regulator-core.c
··· 167 167 struct device_node *parent; 168 168 int num; 169 169 170 - if (!pdev->dev.of_node) 170 + if (!pdev->dev.parent->of_node) 171 171 return -ENODEV; 172 172 173 - parent = of_get_child_by_name(pdev->dev.of_node, "regulators"); 173 + parent = of_get_child_by_name(pdev->dev.parent->of_node, "regulators"); 174 174 if (!parent) 175 175 return -ENODEV; 176 176 ··· 189 189 struct device_node *parent, *child; 190 190 int i, parsed = 0; 191 191 192 - if (!pdev->dev.of_node) 192 + if (!pdev->dev.parent->of_node) 193 193 return NULL; 194 194 195 - parent = of_get_child_by_name(pdev->dev.of_node, "regulators"); 195 + parent = of_get_child_by_name(pdev->dev.parent->of_node, "regulators"); 196 196 if (!parent) 197 197 return NULL; 198 198