ASoC: Do not update the cache if write to hardware failed

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Axel Lin 2010-11-23 14:14:07 +08:00 committed by Mark Brown
parent 92a5288501
commit 7a479b0284

View File

@ -78,8 +78,10 @@ static int tpa6130a2_i2c_write(int reg, u8 value)
if (data->power_state) {
val = i2c_smbus_write_byte_data(tpa6130a2_client, reg, value);
if (val < 0)
if (val < 0) {
dev_err(&tpa6130a2_client->dev, "Write failed\n");
return val;
}
}
/* Either powered on or off, we save the context */