diff options
author | Mark Brown <broonie@kernel.org> | 2014-09-10 15:03:23 +0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-09-10 15:03:23 +0400 |
commit | 3f7c69637511a39f4400dc8312bbcecaa592ab61 (patch) | |
tree | 1d1baaae31beddcbe30177f42023132517711751 /drivers/regulator/core.c | |
parent | dec38b5ce6a9edb406c60c2670b26a1a4262fdb9 (diff) | |
parent | a0c7b164ad115ec0556dc0904ee2218cbc5cedfa (diff) | |
download | linux-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.c | 10 |
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(®ulator_list_mutex); mutex_init(&rdev->mutex); @@ -3585,7 +3590,6 @@ regulator_register(const struct regulator_desc *regulator_desc, /* register with sysfs */ rdev->dev.class = ®ulator_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(®ulator_no) - 1); |