Re: [PATCH RFC] ASoC: simple-card-utils: fix priv->dai_props indexing
From: Kuninori Morimoto
Date: Thu Jan 09 2025 - 21:25:48 EST
Hi Laurentiu
Thank you for your reply
> > - simple_priv_to_props(priv, rtd->id);
> > + simple_priv_to_props(priv, rtd);
>
> ah, thanks for the clarification! correct me if I'm wrong here but the issue
> that I see with the suggested approach is that we have some places in which
> simple_priv_to_props() is used before the RTD is created.
>
> Example scenario: in audio-graph-card2 we call graph_link_init() (which uses simple_priv_to_props)
> before the card is registered (during which the RTD is created).
Do you mean like this ?
Before created RTD: ID is not yet updated : use simple_priv_to_props()
After created RTD: ID is updated : use runtime_simple_priv_to_props()
Is this correct ?
If so, do we need to use them differently ?
In the end, it end up doing the same thing, I think.
If my understanding was correct, it will just makes people confuse, and I
don't want to makes code complex. I think just adding comment why it
don't/can't use rtd->id directly is simple and enough (almost all user
don't care small detail of macros :) but what do you think ?
Thank you for your help !!
Best regards
---
Kuninori Morimoto