diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-05-08 13:10:45 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-03 08:20:34 -0400 |
commit | 3a4b0a07fa69cbfbdd4bc2ebe769cf789949db46 (patch) | |
tree | 7bfaaeea3d8eadd2006c678cc8ea36d17f805844 /drivers/regulator/core.c | |
parent | 361ff5017446605dca8b0a084c826e3d2a0d0a99 (diff) |
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.c | 5 |
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, | |||
3128 | rdev->reg_data = config->driver_data; | 3128 | rdev->reg_data = config->driver_data; |
3129 | rdev->owner = regulator_desc->owner; | 3129 | rdev->owner = regulator_desc->owner; |
3130 | rdev->desc = regulator_desc; | 3130 | rdev->desc = regulator_desc; |
3131 | rdev->regmap = config->regmap; | 3131 | if (config->regmap) |
3132 | rdev->regmap = config->regmap; | ||
3133 | else | ||
3134 | rdev->regmap = dev_get_regmap(dev, NULL); | ||
3132 | INIT_LIST_HEAD(&rdev->consumer_list); | 3135 | INIT_LIST_HEAD(&rdev->consumer_list); |
3133 | INIT_LIST_HEAD(&rdev->list); | 3136 | INIT_LIST_HEAD(&rdev->list); |
3134 | BLOCKING_INIT_NOTIFIER_HEAD(&rdev->notifier); | 3137 | BLOCKING_INIT_NOTIFIER_HEAD(&rdev->notifier); |