Skip to content

Commit 7a479b0

Browse files
AxelLinbroonie
authored andcommitted
ASoC: Do not update the cache if write to hardware failed
Signed-off-by: Axel Lin <[email protected]> Acked-by: Peter Ujfalusi <[email protected]> Acked-by: Liam Girdwood <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 92a5288 commit 7a479b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sound/soc/codecs/tpa6130a2.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ static int tpa6130a2_i2c_write(int reg, u8 value)
7878

7979
if (data->power_state) {
8080
val = i2c_smbus_write_byte_data(tpa6130a2_client, reg, value);
81-
if (val < 0)
81+
if (val < 0) {
8282
dev_err(&tpa6130a2_client->dev, "Write failed\n");
83+
return val;
84+
}
8385
}
8486

8587
/* Either powered on or off, we save the context */

0 commit comments

Comments
 (0)