Merge branch 'for-3.5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
[firefly-linux-kernel-4.4.55.git] / drivers / media / video / cx231xx / cx231xx-audio.c
index a2c2b7d343ec6c05d7bee2f1e1015c9a25a649f6..068f78dc5d13fa0268eef854b4956d18f7521bba 100644 (file)
@@ -523,21 +523,24 @@ static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
 static int snd_cx231xx_hw_capture_params(struct snd_pcm_substream *substream,
                                         struct snd_pcm_hw_params *hw_params)
 {
-       unsigned int channels, rate, format;
        int ret;
 
        dprintk("Setting capture parameters\n");
 
        ret = snd_pcm_alloc_vmalloc_buffer(substream,
                                           params_buffer_bytes(hw_params));
+#if 0
+       /* TODO: set up cx231xx audio chip to deliver the correct audio format,
+          current default is 48000hz multiplexed => 96000hz mono
+          which shouldn't matter since analogue TV only supports mono */
+       unsigned int channels, rate, format;
+
        format = params_format(hw_params);
        rate = params_rate(hw_params);
        channels = params_channels(hw_params);
+#endif
 
-       /* TODO: set up cx231xx audio chip to deliver the correct audio format,
-          current default is 48000hz multiplexed => 96000hz mono
-          which shouldn't matter since analogue TV only supports mono */
-       return 0;
+       return ret;
 }
 
 static int snd_cx231xx_hw_capture_free(struct snd_pcm_substream *substream)
@@ -586,7 +589,7 @@ static int snd_cx231xx_capture_trigger(struct snd_pcm_substream *substream,
                                       int cmd)
 {
        struct cx231xx *dev = snd_pcm_substream_chip(substream);
-       int retval;
+       int retval = 0;
 
        if (dev->state & DEV_DISCONNECTED)
                return -ENODEV;
@@ -601,12 +604,13 @@ static int snd_cx231xx_capture_trigger(struct snd_pcm_substream *substream,
                break;
        default:
                retval = -EINVAL;
+               break;
        }
        spin_unlock(&dev->adev.slock);
 
        schedule_work(&dev->wq_trigger);
 
-       return 0;
+       return retval;
 }
 
 static snd_pcm_uframes_t snd_cx231xx_capture_pointer(struct snd_pcm_substream