浏览代码

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>
Axel Lin 14 年之前
父节点
当前提交
7a479b0284
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      sound/soc/codecs/tpa6130a2.c

+ 3 - 1
sound/soc/codecs/tpa6130a2.c

@@ -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 */