diff options
author | Krzysztof Kozlowski <k.kozlowski@samsung.com> | 2014-01-30 14:51:19 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-01-31 17:52:03 +0100 |
commit | 54820f5802295993b78a373e404e7561039b399d (patch) | |
tree | efeaf27e5e38b7da017f49d87e01012592d86fcd /drivers/regulator/s2mps11.c | |
parent | Merge remote-tracking branches 'regulator/topic/s2mps11', 'regulator/topic/s5... (diff) | |
download | linux-54820f5802295993b78a373e404e7561039b399d.tar.xz linux-54820f5802295993b78a373e404e7561039b399d.zip |
regulator: s2mps11: Fix NULL pointer of_node value when using platform data
When platform_data is used for regulator (of_node of sec-core MFD device
is NULL) the config.of_node for regulator is not initialized. This NULL
value of config.of_node is later stored during regulator_register().
Thus any call by regulator consumers to of_get_regulator() will fail on
of_parse_phandle() returning NULL.
In this case (using platform_data and parent's driver of_node is NULL)
set the config.of_node to reg_node from platform_data.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/s2mps11.c')
-rw-r--r-- | drivers/regulator/s2mps11.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c index d9e557990577..cd0b9e35a56d 100644 --- a/drivers/regulator/s2mps11.c +++ b/drivers/regulator/s2mps11.c @@ -441,6 +441,7 @@ common_reg: for (i = 0; i < S2MPS11_REGULATOR_MAX; i++) { if (!reg_np) { config.init_data = pdata->regulators[i].initdata; + config.of_node = pdata->regulators[i].reg_node; } else { config.init_data = rdata[i].init_data; config.of_node = rdata[i].of_node; |