Merge branch 'for-linus' into for-next
[linux-block.git] / sound / core / pcm_lib.c
index 40013b26f67196b23bcf94d69890b2835cde9f9d..bcb06bd3d81d1703d43c0538d7c8ae327ebb91dd 100644 (file)
@@ -2177,16 +2177,11 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
                snd_pcm_update_hw_ptr(substream);
 
        if (!is_playback &&
-           runtime->status->state == SNDRV_PCM_STATE_PREPARED) {
-               if (size >= runtime->start_threshold) {
-                       err = snd_pcm_start(substream);
-                       if (err < 0)
-                               goto _end_unlock;
-               } else {
-                       /* nothing to do */
-                       err = 0;
+           runtime->status->state == SNDRV_PCM_STATE_PREPARED &&
+           size >= runtime->start_threshold) {
+               err = snd_pcm_start(substream);
+               if (err < 0)
                        goto _end_unlock;
-               }
        }
 
        avail = snd_pcm_avail(substream);
@@ -2219,9 +2214,8 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
                if (frames > cont)
                        frames = cont;
                if (snd_BUG_ON(!frames)) {
-                       runtime->twake = 0;
-                       snd_pcm_stream_unlock_irq(substream);
-                       return -EINVAL;
+                       err = -EINVAL;
+                       goto _end_unlock;
                }
                snd_pcm_stream_unlock_irq(substream);
                err = writer(substream, appl_ofs, data, offset, frames,