]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00255029 ASoC: spdif: fix clk_enable/disable() mismatched issue
authorNicolin Chen <b42378@freescale.com>
Wed, 20 Mar 2013 03:09:17 +0000 (11:09 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:58 +0000 (08:35 +0200)
  The function might be returned if the CNEW wasn't detected, while in this
case the code won't disable the clk.
  This patch just fixed the mismatch.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
sound/soc/codecs/mxc_spdif.c

index 77e62aefe42242226c7d32e37284716d299ef39b..b358f719f195a941ae81d6e4441fea38be2a26c6 100644 (file)
@@ -888,8 +888,10 @@ static int mxc_spdif_capture_get(struct snd_kcontrol *kcontrol,
 
        clk_enable(plat_data->spdif_clk);
 
-       if (!(__raw_readl(spdif_base_addr + SPDIF_REG_SIS) & INT_CNEW))
+       if (!(__raw_readl(spdif_base_addr + SPDIF_REG_SIS) & INT_CNEW)) {
+               clk_disable(plat_data->spdif_clk);
                return -EAGAIN;
+       }
 
        cstatus = __raw_readl(spdif_base_addr + SPDIF_REG_SRCSLH);
        ucontrol->value.iec958.status[0] = (cstatus >> 16) & 0xFF;