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:
Kai Vehmanen 2022-12-30 14:30:44 +02:00 committed by Carles Cufí
commit 8374325062

View file

@ -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;
}