aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-14 01:50:38 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2013-04-08 09:20:56 -0400
commit4816bd1c6d5589135523b4263be2e1b8b8c97599 (patch)
tree14d3b8df4a763b69df89a8b7362215546d53b94b
parent1816cb3409f1f6909e25e52effc57857803c678c (diff)
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 b562c7bf8a46..0962c558dc02 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)
235 235
236 ret = arizona_wait_for_boot(arizona); 236 ret = arizona_wait_for_boot(arizona);
237 if (ret != 0) { 237 if (ret != 0) {
238 regulator_disable(arizona->dcvdd); 238 goto err;
239 return ret;
240 } 239 }
241 240
242 ret = regcache_sync(arizona->regmap); 241 ret = regcache_sync(arizona->regmap);
243 if (ret != 0) { 242 if (ret != 0) {
244 dev_err(arizona->dev, "Failed to restore register cache\n"); 243 dev_err(arizona->dev, "Failed to restore register cache\n");
245 regulator_disable(arizona->dcvdd); 244 goto err;
246 return ret;
247 } 245 }
248 246
249 return 0; 247 return 0;
248
249err:
250 regcache_cache_only(arizona->regmap, true);
251 regulator_disable(arizona->dcvdd);
252 return ret;
250} 253}
251 254
252static int arizona_runtime_suspend(struct device *dev) 255static int arizona_runtime_suspend(struct device *dev)