aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/mc13892-regulator.c
diff options
context:
space:
mode:
authorGuodong Xu <guodong.xu@linaro.org>2014-08-19 18:07:41 +0800
committerMark Brown <broonie@linaro.org>2014-08-19 10:36:07 -0500
commit39f5460d7f9cc57d3dd745301bf60ca5d65a6e7b (patch)
tree5a7ca3a5017af68dc4be6b3077779d49b4bafbfd /drivers/regulator/mc13892-regulator.c
parentregulator: core: Fix build error due to const qualifier for ops (diff)
downloadlinux-dev-39f5460d7f9cc57d3dd745301bf60ca5d65a6e7b.tar.xz
linux-dev-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/mc13892-regulator.c')
-rw-r--r--drivers/regulator/mc13892-regulator.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c
index f374fa57220f..793b662a1967 100644
--- a/drivers/regulator/mc13892-regulator.c
+++ b/drivers/regulator/mc13892-regulator.c
@@ -526,6 +526,7 @@ static unsigned int mc13892_vcam_get_mode(struct regulator_dev *rdev)
return REGULATOR_MODE_NORMAL;
}
+static struct regulator_ops mc13892_vcam_ops;
static int mc13892_regulator_probe(struct platform_device *pdev)
{
@@ -582,10 +583,12 @@ static int mc13892_regulator_probe(struct platform_device *pdev)
}
mc13xxx_unlock(mc13892);
- mc13892_regulators[MC13892_VCAM].desc.ops->set_mode
- = mc13892_vcam_set_mode;
- mc13892_regulators[MC13892_VCAM].desc.ops->get_mode
- = mc13892_vcam_get_mode;
+ /* update mc13892_vcam ops */
+ memcpy(&mc13892_vcam_ops, mc13892_regulators[MC13892_VCAM].desc.ops,
+ sizeof(struct regulator_ops));
+ mc13892_vcam_ops.set_mode = mc13892_vcam_set_mode,
+ mc13892_vcam_ops.get_mode = mc13892_vcam_get_mode,
+ mc13892_regulators[MC13892_VCAM].desc.ops = &mc13892_vcam_ops;
mc13xxx_data = mc13xxx_parse_regulators_dt(pdev, mc13892_regulators,
ARRAY_SIZE(mc13892_regulators));