Skip to content

Commit

Permalink
ASoC: fsi: fsi_stream_is_working() care substream->runtime
Browse files Browse the repository at this point in the history
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Feb 3, 2012
1 parent 180346e commit 97df818
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sound/soc/sh/fsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 97df818

Please sign in to comment.