[ARM] tegra_i2s_audio: add a few overlooked checks
authorIliyan Malchev <malchev@google.com>
Fri, 15 Oct 2010 21:13:48 +0000 (14:13 -0700)
committerIliyan Malchev <malchev@google.com>
Sun, 17 Oct 2010 02:56:22 +0000 (19:56 -0700)
Signed-off-by: Iliyan Malchev <malchev@google.com>
arch/arm/mach-tegra/tegra_i2s_audio.c

index 64ba1be2ab1f9cfc355c282bb1278e8254341f9e..48b1bec21f67a8314515288e0bccc0f26a0d969f 100644 (file)
@@ -947,7 +947,7 @@ static int resume_dma_recording(struct audio_stream *ais)
 
        if (ais->dma_has_it) {
                pr_debug("%s: recording already in progress\n", __func__);
-               return 0;
+               return -EALREADY;
        }
 
        /* Don't send all the data yet. */
@@ -1035,7 +1035,7 @@ static int start_pio_playback(struct audio_stream *aos)
 
        if (i2s_is_fifo_enabled(ads->i2s_base, I2S_FIFO_TX)) {
                pr_debug("%s: playback is already in progress\n", __func__);
-               return 0;
+               return -EALREADY;
        }
 
        pr_debug("%s\n", __func__);
@@ -1080,7 +1080,7 @@ static int start_pio_recording(struct audio_stream *ais)
 
        if (i2s_is_fifo_enabled(ads->i2s_base, I2S_FIFO_RX)) {
                pr_debug("%s: already started\n", __func__);
-               return 0;
+               return -EALREADY;
        }
 
        pr_debug("%s: start\n", __func__);
@@ -1285,7 +1285,7 @@ again:
        }
 
        rc = start_playback(&ads->out);
-       if (rc < 0) {
+       if (rc < 0 && rc != -EALREADY) {
                pr_err("%s: could not start playback: %d\n", __func__, rc);
                goto done;
        }