mfd: arizona: Check errors from regcache_sync()
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 4 Jan 2013 17:16:12 +0000 (17:16 +0000)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 22 Jan 2013 02:12:44 +0000 (03:12 +0100)
If the control bus is unrelabile we may hit errors during regcache_sync(),
especially given that it tends to be one the most dense bursts of I/O in
many systems.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/arizona-core.c

index bc8a3ed..222c03a 100644 (file)
@@ -239,7 +239,12 @@ static int arizona_runtime_resume(struct device *dev)
                return ret;
        }
 
-       regcache_sync(arizona->regmap);
+       ret = regcache_sync(arizona->regmap);
+       if (ret != 0) {
+               dev_err(arizona->dev, "Failed to restore register cache\n");
+               regulator_disable(arizona->dcvdd);
+               return ret;
+       }
 
        return 0;
 }