提交 ee057d2e 编写于 作者: K Kuninori Morimoto 提交者: Mark Brown

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: NNguyen Viet Dung <nv-dung@jinso.co.jp>
Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 1a5658c2
...@@ -316,11 +316,15 @@ static u32 rsnd_dmapp_get_id(struct rsnd_dai_stream *io, ...@@ -316,11 +316,15 @@ static u32 rsnd_dmapp_get_id(struct rsnd_dai_stream *io,
size = ARRAY_SIZE(gen2_id_table_cmd); size = ARRAY_SIZE(gen2_id_table_cmd);
} }
if (!entry) if ((!entry) || (size <= id)) {
return 0xFF; struct device *dev = rsnd_priv_to_dev(rsnd_io_to_priv(io));
if (size <= id) dev_err(dev, "unknown connection (%s[%d])\n",
return 0xFF; rsnd_mod_name(mod), rsnd_mod_id(mod));
/* use non-prohibited SRS number as error */
return 0x00; /* SSI00 */
}
return entry[id]; return entry[id];
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册