Re: [PATCH 1/2] ASoC: simple-card: Introduce playback-only/capture only DAI link flags

From: Kuninori Morimoto
Date: Tue Aug 01 2023 - 19:31:26 EST



Hi Daniel

Thank you for your patch.
This is not a big deal, but...

> We need this to signal that DAI link supports only 1 direction that
> can only be either playback or capture.
(snip)
> + if (of_property_read_bool(node, "playback-only"))
> + is_playback_only = true;
> +
> + if (of_property_read_bool(node, "capture-only"))
> + is_capture_only = true;

More simply

is_playback_only = of_property_read_bool(node, "playback-only");
is_capture_only = of_property_read_bool(node, "capture-only");

> + ret = asoc_simple_parse_link_direction(dev, node, prefix,
> + &is_playback_only,
> + &is_capture_only);
> + if (ret < 0)
> + return 0;
> +
> + dai_link->playback_only = is_playback_only;
> + dai_link->capture_only = is_capture_only;

It doesn't overwrite when error case, so
More simply

ret = asoc_simple_parse_link_direction(dev, node, prefix,
&dai_link->playback_only,
&dai_link->capture_only);


Thank you for your help !!

Best regards
---
Kuninori Morimoto