ASoC: fsi: fsi_stream_is_working() care substream->runtime
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 3 Feb 2012 08:57:40 +0000 (00:57 -0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 3 Feb 2012 11:55:40 +0000 (11:55 +0000)
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/sh/fsi.c

index 8d05e59c88313418f5c260ec671dfdcc78e00289..1e10184af89a3921ce62b2ca9c52407b60556fde 100644 (file)
@@ -450,7 +450,7 @@ static int fsi_stream_is_working(struct fsi_priv *fsi,
        int ret;
 
        spin_lock_irqsave(&master->lock, flags);
-       ret = !!io->substream;
+       ret = !!(io->substream && io->substream->runtime);
        spin_unlock_irqrestore(&master->lock, flags);
 
        return ret;
@@ -756,9 +756,7 @@ static int fsi_pio_transfer(struct fsi_priv *fsi, struct fsi_stream *io,
        u8 *buf;
        int over_period;
 
-       if (!fsi                        ||
-           !io->substream              ||
-           !io->substream->runtime)
+       if (!fsi_stream_is_working(fsi, io))
                return -EINVAL;
 
        over_period     = 0;