Skip to content

Commit 8374325

Browse files
kv2019icarlescufi
authored andcommitted
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: thesofproject/sof#6896 Signed-off-by: Kai Vehmanen <[email protected]>
1 parent d8ac658 commit 8374325

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/dai/intel/dmic/dmic.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,9 @@ static const struct dai_config *dai_dmic_get_config(const struct device *dev, en
743743
{
744744
struct dai_intel_dmic *dmic = (struct dai_intel_dmic *)dev->data;
745745

746-
__ASSERT_NO_MSG(dir == DAI_DIR_RX);
746+
if (dir != DAI_DIR_RX)
747+
return NULL;
748+
747749
return &dmic->dai_config_params;
748750
}
749751

0 commit comments

Comments
 (0)