drivers: dai: intel: dmic: don't use assert for error handling
The dai.h interface does not prohibit calling dai_config_get() with different direction values. The dmic driver should handle invalid direction value explicitly and not rely on an assert. Link: https://github.com/thesofproject/sof/issues/6896 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This commit is contained in:
parent
d8ac658578
commit
8374325062
1 changed files with 3 additions and 1 deletions
|
@ -743,7 +743,9 @@ static const struct dai_config *dai_dmic_get_config(const struct device *dev, en
|
|||
{
|
||||
struct dai_intel_dmic *dmic = (struct dai_intel_dmic *)dev->data;
|
||||
|
||||
__ASSERT_NO_MSG(dir == DAI_DIR_RX);
|
||||
if (dir != DAI_DIR_RX)
|
||||
return NULL;
|
||||
|
||||
return &dmic->dai_config_params;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue