From: Axel Lin Date: Tue, 23 Nov 2010 06:14:07 +0000 (+0800) Subject: ASoC: Do not update the cache if write to hardware failed X-Git-Tag: upstream/snapshot3+hdmi~12174^2~11^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a479b02843c8d78ef51a64d1168592258440c97;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ASoC: Do not update the cache if write to hardware failed Signed-off-by: Axel Lin Acked-by: Peter Ujfalusi Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index ee4fb20..d2c2430 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/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 */