]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: wsa881x: Use new SoundWire enumeration helper
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Mon, 8 Jun 2026 10:27:06 +0000 (11:27 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 11 Jun 2026 19:46:49 +0000 (20:46 +0100)
Now the new wait for SoundWire enumeration helper no longer depends on
unattach_request it can be used for code that also doesn't check this
flag. 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-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wsa881x.c

index d15fda648dadad7cc4eee08ba5c4acf19ea6f15f..5174614c3e83784892baebe446a8164dfc02dedd 100644 (file)
@@ -1167,16 +1167,14 @@ static int wsa881x_runtime_resume(struct device *dev)
        struct sdw_slave *slave = dev_to_sdw_dev(dev);
        struct regmap *regmap = dev_get_regmap(dev, NULL);
        struct wsa881x_priv *wsa881x = dev_get_drvdata(dev);
-       unsigned long time;
+       int ret;
 
        gpiod_direction_output(wsa881x->sd_n, 0);
 
-       time = wait_for_completion_timeout(&slave->initialization_complete,
-                                          msecs_to_jiffies(WSA881X_PROBE_TIMEOUT));
-       if (!time) {
-               dev_err(dev, "Initialization not complete, timed out\n");
+       ret = sdw_slave_wait_for_init(slave, WSA881X_PROBE_TIMEOUT);
+       if (ret) {
                gpiod_direction_output(wsa881x->sd_n, 1);
-               return -ETIMEDOUT;
+               return ret;
        }
 
        regcache_cache_only(regmap, false);