On 2025-12-10 6:26 AM, Oder Chiou wrote:
-----Original Message----- From: Krzysztof Kozlowski krzk@kernel.org Sent: Tuesday, December 9, 2025 2:08 PM To: Oder Chiou oder_chiou@realtek.com; cezary.rojewski@intel.com; broonie@kernel.org; lgirdwood@gmail.com; robh@kernel.org; krzk+dt@kernel.org; conor+dt@kernel.org Cc: perex@perex.cz; linux-sound@vger.kernel.org; devicetree@vger.kernel.org; alsa-devel@alsa-project.org; Flove(HsinFu) flove@realtek.com; Shuming [范 書銘] shumingf@realtek.com; Jack Yu jack.yu@realtek.com; Derek [方德 義] derek.fang@realtek.com Subject: Re: [PATCH v8 1/2] ASoC: rt5575: Add the codec driver for the ALC5575
...
Ah, so for that reason you created that singleton, exported it and you wait for it? Singletons are pretty no-go anyway, how do you handle to codecs in the system? Fragile design.
The code will be implemented in the top of the i2c_probe() as following.
if (dev_type == RT5575_WITHOUT_FLASH) { if (IS_ENABLED(CONFIG_SND_SOC_RT5575_SPI)) { if (!rt5575_spi) { dev_err(dev, "Wait SPI driver ready\n"); return -EPROBE_DEFER; } } else { dev_err(dev, "This dev type should enable CONFIG_SND_SOC_RT5575_SPI\n"); return -ENODEV; } }
The idea is to get rid of 'rt5575_spi' global. Removing 'rt5575_spi_ready' was just one of the steps to improve the flow. Removal of 'rt5575_spi' is the next one.