ASoC: tegra: Fix bit-format checking
Jubeom Kim [Fri, 27 Apr 2012 07:19:30 +0000 (16:19 +0900)]
condition to check bit-format is always false
because TEGRA20_I2S_CTRL_BIT_FORMAT_I2S is zero.

Bug 947429

Change-Id: Ieb92f0732b092100dc1bf323ad60aff4439d5b3d
Signed-off-by: Jubeom Kim <jubeomk@nvidia.com>
Reviewed-on: http://git-master/r/99341
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>

sound/soc/tegra/tegra20_i2s.c

index e6de1c0..d90c099 100644 (file)
@@ -191,8 +191,9 @@ static int tegra20_i2s_hw_params(struct snd_pcm_substream *substream,
        struct tegra20_i2s *i2s = snd_soc_dai_get_drvdata(dai);
        u32 reg;
        int ret, sample_size, srate, i2sclock, bitcnt, i2sclk_div;
+       u32 bit_format = i2s->reg_ctrl & TEGRA20_I2S_CTRL_BIT_FORMAT_MASK;
 
-       if ((i2s->reg_ctrl & TEGRA20_I2S_CTRL_BIT_FORMAT_I2S) &&
+       if ((bit_format == TEGRA20_I2S_CTRL_BIT_FORMAT_I2S) &&
            (params_channels(params) != 2)) {
                dev_err(dev, "Only Stereo is supported in I2s mode\n");
                return -EINVAL;