summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown2012-05-08 19:10:45 +0200
committerMark Brown2012-06-03 14:20:34 +0200
commit3a4b0a07fa69cbfbdd4bc2ebe769cf789949db46 (patch)
tree7bfaaeea3d8eadd2006c678cc8ea36d17f805844 /drivers/regulator/core.c
parentregulator: Use newly added devres_release() rather than open coding (diff)
downloadkernel-qcow2-linux-3a4b0a07fa69cbfbdd4bc2ebe769cf789949db46.tar.gz
kernel-qcow2-linux-3a4b0a07fa69cbfbdd4bc2ebe769cf789949db46.tar.xz
kernel-qcow2-linux-3a4b0a07fa69cbfbdd4bc2ebe769cf789949db46.zip
regulator: core: Use dev_get_regmap() to find the regmap
If no regmap is explicitly specified then use dev_get_regmap() to obtain one. The driver must explicitly enable any actual usage of the regmap so there's no concern with unwanted usage. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 7965e86a3fbb..8521e0d6b3bc 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3128,7 +3128,10 @@ regulator_register(const struct regulator_desc *regulator_desc,
rdev->reg_data = config->driver_data;
rdev->owner = regulator_desc->owner;
rdev->desc = regulator_desc;
- rdev->regmap = config->regmap;
+ if (config->regmap)
+ rdev->regmap = config->regmap;
+ else
+ rdev->regmap = dev_get_regmap(dev, NULL);
INIT_LIST_HEAD(&rdev->consumer_list);
INIT_LIST_HEAD(&rdev->list);
BLOCKING_INIT_NOTIFIER_HEAD(&rdev->notifier);