diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2016-05-10 02:22:37 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-05-10 19:10:57 +0100 |
commit | ee057d2ee73259f455cfbb7a4db808fc6b6405dd (patch) | |
tree | 2b52b032437a4e510ac1701a39d4ac145a302d28 /sound | |
parent | 1a5658c213116d56a1a38e83588f6636a57d6374 (diff) |
ASoC: rsnd: don't use prohibited number to PDMACHCRn.SRS
Current rsnd_dmapp_get_id() returns 0xFF as error code if system used
strange connection. It will be used as PDMACHCRn.SRS, but 0xFF is
prohibited number.
In order not to use prohibited number, this patch indicates error message
and returns 0x00 (same as SSI00) in error case.
Special thanks to Dung-san.
Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/sh/rcar/dma.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c index 7658e8fd7bdc..6bc93cbb3049 100644 --- a/sound/soc/sh/rcar/dma.c +++ b/sound/soc/sh/rcar/dma.c @@ -316,11 +316,15 @@ static u32 rsnd_dmapp_get_id(struct rsnd_dai_stream *io, size = ARRAY_SIZE(gen2_id_table_cmd); } - if (!entry) - return 0xFF; + if ((!entry) || (size <= id)) { + struct device *dev = rsnd_priv_to_dev(rsnd_io_to_priv(io)); - if (size <= id) - return 0xFF; + dev_err(dev, "unknown connection (%s[%d])\n", + rsnd_mod_name(mod), rsnd_mod_id(mod)); + + /* use non-prohibited SRS number as error */ + return 0x00; /* SSI00 */ + } return entry[id]; } |