Skip to content

Commit

Permalink
mfd: arizona: Clean up on failed runtime resume
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Apr 8, 2013
1 parent 1816cb3 commit 4816bd1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/mfd/arizona-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4816bd1

Please sign in to comment.