diff options
author | Guodong Xu <guodong.xu@linaro.org> | 2014-08-19 18:07:41 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-08-19 10:36:07 -0500 |
commit | 39f5460d7f9cc57d3dd745301bf60ca5d65a6e7b (patch) | |
tree | 5a7ca3a5017af68dc4be6b3077779d49b4bafbfd /drivers/regulator/core.c | |
parent | 716845ebeb505353d900320b4a74e8330520410d (diff) | |
download | linux-39f5460d7f9cc57d3dd745301bf60ca5d65a6e7b.tar.gz linux-39f5460d7f9cc57d3dd745301bf60ca5d65a6e7b.tar.bz2 linux-39f5460d7f9cc57d3dd745301bf60ca5d65a6e7b.zip |
regulator: core: add const to regulator_ops and fix build error in mc13892
Commit 272e2315fac3 ("regulator: core: add const qualifier to ops in
struct regulator_desc") introduced const qualifier to ops in regulator_desc.
This patch adds 'const' to regulator_ops vars in newly added core APIs
for v3.17-rc1:
- regulator_get_hardware_vsel_register()
- regulator_list_hardware_vsel()
This patch also fix a build error in mc13892-regulator.c due to const
regulator_desc.ops. Modification of regulator_desc.ops' member fields is not
allowed.
Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 1e976b6320a2..7bce7158d7e6 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2307,8 +2307,8 @@ int regulator_get_hardware_vsel_register(struct regulator *regulator, unsigned *vsel_reg, unsigned *vsel_mask) { - struct regulator_dev *rdev = regulator->rdev; - struct regulator_ops *ops = rdev->desc->ops; + struct regulator_dev *rdev = regulator->rdev; + const struct regulator_ops *ops = rdev->desc->ops; if (ops->set_voltage_sel != regulator_set_voltage_sel_regmap) return -EOPNOTSUPP; @@ -2334,8 +2334,8 @@ EXPORT_SYMBOL_GPL(regulator_get_hardware_vsel_register); int regulator_list_hardware_vsel(struct regulator *regulator, unsigned selector) { - struct regulator_dev *rdev = regulator->rdev; - struct regulator_ops *ops = rdev->desc->ops; + struct regulator_dev *rdev = regulator->rdev; + const struct regulator_ops *ops = rdev->desc->ops; if (selector >= rdev->desc->n_voltages) return -EINVAL; |