ASoC: remove unnesssary log message for virtual port

Remove unnessary log message for virtual port or it will print a lot of error
message while driver work normal.

Change-Id: Ie8d6e955fc4eaeda169bb92bdc58769c9c005a4e
Signed-off-by: Fei Tong <ftong@codeaurora.org>
This commit is contained in:
Fei Tong 2021-02-09 11:50:26 +08:00
commit 766e9afba0

27
dsp/q6afe.c Normal file → Executable file
View file

@ -8628,10 +8628,8 @@ done:
}
EXPORT_SYMBOL(afe_set_display_stream);
int afe_validate_port(u16 port_id)
static bool is_port_valid(u16 port_id)
{
int ret;
switch (port_id) {
case PRIMARY_I2S_RX:
case PRIMARY_I2S_TX:
@ -8841,15 +8839,23 @@ int afe_validate_port(u16 port_id)
case RT_PROXY_PORT_002_RX:
case RT_PROXY_PORT_002_TX:
{
ret = 0;
break;
return true;
}
default:
return false;
}
}
int afe_validate_port(u16 port_id)
{
int ret;
if (is_port_valid(port_id)) {
ret = 0;
} else {
pr_err("%s: default ret 0x%x\n", __func__, port_id);
ret = -EINVAL;
}
return ret;
}
@ -8884,7 +8890,9 @@ int afe_convert_virtual_to_portid(u16 port_id)
* if port_id is virtual, convert to physical..
* if port_id is already physical, return physical
*/
if (afe_validate_port(port_id) < 0) {
if (is_port_valid(port_id)) {
ret = port_id;
} else {
if (port_id == RT_PROXY_DAI_001_RX ||
port_id == RT_PROXY_DAI_001_TX ||
port_id == RT_PROXY_DAI_002_RX ||
@ -8897,8 +8905,7 @@ int afe_convert_virtual_to_portid(u16 port_id)
__func__, port_id);
ret = -EINVAL;
}
} else
ret = port_id;
}
return ret;
}