ASoC: Report an error for unknown adav80x formats
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 16 Jul 2011 02:34:58 +0000 (11:34 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 17 Jul 2011 04:15:20 +0000 (13:15 +0900)
Not only fixes error handling but also some uninitialized variable
warnings.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
sound/soc/codecs/adav80x.c

index e30fba62392dd439e53a16f0f1c1e70f0f8025e7..300c04b70e71ba3680a1f522451a94277682a059 100644 (file)
@@ -456,7 +456,7 @@ static int adav80x_set_capture_pcm_format(struct snd_soc_codec *codec,
                val = ADAV80X_CAPTURE_WORD_LEN24;
                break;
        default:
-               break;
+               return -EINVAL;
        }
 
        snd_soc_update_bits(codec, adav80x_port_ctrl_regs[dai->id][0],
@@ -488,7 +488,7 @@ static int adav80x_set_playback_pcm_format(struct snd_soc_codec *codec,
                val = ADAV80X_PLAYBACK_MODE_RIGHT_J_24;
                break;
        default:
-               break;
+               return -EINVAL;
        }
 
        snd_soc_update_bits(codec, adav80x_port_ctrl_regs[dai->id][1],