]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: pm4125: Use new SoundWire enumeration helper
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Mon, 8 Jun 2026 10:27:09 +0000 (11:27 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 11 Jun 2026 19:46:51 +0000 (20:46 +0100)
Now the new wait for SoundWire enumeration helper no longer depends on
unattach_request it is safe to use from probe time. Update the driver
to use the new core helper.

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260608102714.2503120-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/pm4125.c

index 1f0a3f5389f1b3a505e2adeb5bf505e4b93fefad..29655175ea2891850fb04a4e739c950572a75e89 100644 (file)
@@ -1309,17 +1309,12 @@ static int pm4125_irq_init(struct pm4125_priv *pm4125, struct device *dev)
 static int pm4125_soc_codec_probe(struct snd_soc_component *component)
 {
        struct pm4125_priv *pm4125 = snd_soc_component_get_drvdata(component);
-       struct sdw_slave *tx_sdw_dev = pm4125->tx_sdw_dev;
        struct device *dev = component->dev;
-       unsigned long time_left;
        int i, ret;
 
-       time_left = wait_for_completion_timeout(&tx_sdw_dev->initialization_complete,
-                                               msecs_to_jiffies(5000));
-       if (!time_left) {
-               dev_err(dev, "soundwire device init timeout\n");
-               return -ETIMEDOUT;
-       }
+       ret = sdw_slave_wait_for_init(pm4125->tx_sdw_dev, 5000);
+       if (ret)
+               return ret;
 
        snd_soc_component_init_regmap(component, pm4125->regmap);
        ret = pm_runtime_resume_and_get(dev);