summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-14 06:50:38 (GMT)
committerSamuel Ortiz <sameo@linux.intel.com>2013-04-08 13:20:56 (GMT)
commit4816bd1c6d5589135523b4263be2e1b8b8c97599 (patch)
tree14d3b8df4a763b69df89a8b7362215546d53b94b
parent1816cb3409f1f6909e25e52effc57857803c678c (diff)
downloadlinux-fsl-qoriq-4816bd1c6d5589135523b4263be2e1b8b8c97599.tar.xz
mfd: arizona: Clean up on failed runtime resume
Make sure that we don't leave the device enabled needlessly. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/arizona-core.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index b562c7b..0962c55 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -235,18 +235,21 @@ static int arizona_runtime_resume(struct device *dev)
ret = arizona_wait_for_boot(arizona);
if (ret != 0) {
- regulator_disable(arizona->dcvdd);
- return ret;
+ goto err;
}
ret = regcache_sync(arizona->regmap);
if (ret != 0) {
dev_err(arizona->dev, "Failed to restore register cache\n");
- regulator_disable(arizona->dcvdd);
- return ret;
+ goto err;
}
return 0;
+
+err:
+ regcache_cache_only(arizona->regmap, true);
+ regulator_disable(arizona->dcvdd);
+ return ret;
}
static int arizona_runtime_suspend(struct device *dev)