]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
ASoC: qcom: Return an error for invalid PCM trigger command
authorTakashi Iwai <tiwai@suse.de>
Mon, 13 Apr 2015 12:23:29 +0000 (14:23 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 15 Apr 2015 16:04:15 +0000 (17:04 +0100)
Fix a compile warning
  sound/soc/qcom/lpass-cpu.c: In function ‘lpass_cpu_daiops_trigger’:
  sound/soc/qcom/lpass-cpu.c:224:2: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    return ret;
      ^
Although switch () lists the most of existing cases, it's still better
to cover the rest as an error properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/lpass-cpu.c

index 6698d058de29600a464be79490bec641736819c3..dc790abaa3318e4760107c726ac02ea7e2c1a2cb 100644 (file)
@@ -194,7 +194,7 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
                int cmd, struct snd_soc_dai *dai)
 {
        struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
-       int ret;
+       int ret = -EINVAL;
 
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START: