ASoC: dwc: fix support for more than two channels
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 25 Jan 2013 06:43:43 +0000 (09:43 +0300)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 26 Jan 2013 07:37:09 +0000 (15:37 +0800)
There were missing break statements so everything used
TWO_CHANNEL_SUPPORT.

Also I added a return statement to silence a GCC warning:

sound/soc/dwc/designware_i2s.c: In function ‘dw_i2s_hw_params’:
sound/soc/dwc/designware_i2s.c:236:32: warning: ‘ch_reg’ may be
used uninitialized in this function
[-Wmaybe-uninitialized]

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/dwc/designware_i2s.c

index 1aa51300c564b3d7b6e3c4a55eb61268d5e1f9b0..deb30d59965e770a9c8096f5c92b1767f51f96cf 100644 (file)
@@ -210,15 +210,19 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream,
        switch (config->chan_nr) {
        case EIGHT_CHANNEL_SUPPORT:
                ch_reg = 3;
+               break;
        case SIX_CHANNEL_SUPPORT:
                ch_reg = 2;
+               break;
        case FOUR_CHANNEL_SUPPORT:
                ch_reg = 1;
+               break;
        case TWO_CHANNEL_SUPPORT:
                ch_reg = 0;
                break;
        default:
                dev_err(dev->dev, "channel not supported\n");
+               return -EINVAL;
        }
 
        i2s_disable_channels(dev, substream->stream);