summaryrefslogtreecommitdiff
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2014-09-10 15:03:23 +0400
committerMark Brown <broonie@kernel.org>2014-09-10 15:03:23 +0400
commit3f7c69637511a39f4400dc8312bbcecaa592ab61 (patch)
tree1d1baaae31beddcbe30177f42023132517711751 /drivers/regulator/core.c
parentdec38b5ce6a9edb406c60c2670b26a1a4262fdb9 (diff)
parenta0c7b164ad115ec0556dc0904ee2218cbc5cedfa (diff)
downloadlinux-3f7c69637511a39f4400dc8312bbcecaa592ab61.tar.xz
Merge branch 'topic/of' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-isl9305
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 1e976b6320a2..75aa49085763 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3553,12 +3553,17 @@ regulator_register(const struct regulator_desc *regulator_desc,
return ERR_PTR(-EINVAL);
}
- init_data = config->init_data;
-
rdev = kzalloc(sizeof(struct regulator_dev), GFP_KERNEL);
if (rdev == NULL)
return ERR_PTR(-ENOMEM);
+ init_data = regulator_of_get_init_data(dev, regulator_desc,
+ &rdev->dev.of_node);
+ if (!init_data) {
+ init_data = config->init_data;
+ rdev->dev.of_node = of_node_get(config->of_node);
+ }
+
mutex_lock(&regulator_list_mutex);
mutex_init(&rdev->mutex);
@@ -3585,7 +3590,6 @@ regulator_register(const struct regulator_desc *regulator_desc,
/* register with sysfs */
rdev->dev.class = &regulator_class;
- rdev->dev.of_node = of_node_get(config->of_node);
rdev->dev.parent = dev;
dev_set_name(&rdev->dev, "regulator.%d",
atomic_inc_return(&regulator_no) - 1);