3 Mar
2022
3 Mar
'22
6:16 a.m.
On Wed, Mar 02, 2022 at 12:07:39PM +0800, Jiaxin Yu wrote:
On Tue, 2022-03-01 at 17:03 +0800, Tzung-Bi Shih wrote:
After seeing the code, I am starting to wonder if the reuse is overkill. If they (RT5682 vs. RT5682S) only have some minor differences, probably it could reuse more by:
SND_SOC_DAILINK_DEFS(i2s8, ... SND_SOC_DAILINK_DEFS(i2s9, ...
...
if (card == &mt8192_mt6359_rt1015p_rt5682s_card) { i2s8_codecs.name = RT5682S_DEV0_NAME; i2s8_codecs.dai_name = RT5682S_CODEC_DAI; ... }
Or even uses of_device_is_compatible() if it would like to reuse the struct snd_soc_card.
If we reuse the struct snd_soc_card, the card .name will be same. Should I change the card .name through of_device_is_compatible()?
Exactly yes.