Hi Lars, Mark
In my opinion the flags are just as much a hack as the pointer. In an ideal setup the component does not need to know what type it is. The reason why we need this in ASoC is because the framework has grown over time and we need to support legacy code.
Yes, the pointer is essentially already a flag - having a separate flag really doesn't add a huge amount here. What we need to do is get rid of the need for the flag entirely.
I can agree to remove flag entirely, and actually it is my final target. But we need many steps for it IMO.
I would like to cleanup (= remove random pointer) as 1st step. My 1st concern is that each struct which want to have codec pointer has codec pointer randomly. And it makes component cleanup difficult IMO.
2nd concern is rtd has *codec, *platform, and *dai (for cpu/codec). These are different type of pointer. If platform can have dummy *dai, we can do like below ?
struct snd_soc_pcm_runtime { ... struct snd_soc_dai *cpu; struct snd_soc_dai *codec; struct snd_soc_dai *platform; ... }
Here, we can get original *codec or *platform by using component_to_xxx, because dai already have *component; It can be more cleanup ?