| From fefc4953a08d796f8e66ab7e388b589f7a564aaa Mon Sep 17 00:00:00 2001 |
| From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| Date: Fri, 3 Feb 2012 00:57:40 -0800 |
| Subject: ASoC: fsi: fsi_stream_is_working() care substream->runtime |
| |
| Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> |
| (cherry picked from commit 97df81873e9c1391319dd818bc4b6856517e4939) |
| |
| Signed-off-by: Simon Horman <horms@verge.net.au> |
| --- |
| sound/soc/sh/fsi.c | 6 ++---- |
| 1 file changed, 2 insertions(+), 4 deletions(-) |
| |
| diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c |
| index 8d05e59..1e10184 100644 |
| --- a/sound/soc/sh/fsi.c |
| +++ b/sound/soc/sh/fsi.c |
| @@ -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; |
| -- |
| 1.7.10.2.565.gbd578b5 |
| |