From: Charles Keepax Date: Tue, 12 May 2026 10:30:07 +0000 (+0100) Subject: ASoC: cs42l42: Use new SoundWire enumeration helper X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47e2f687b0c50102d487c06f11157389d28846ba;p=thirdparty%2Fkernel%2Flinux.git ASoC: cs42l42: Use new SoundWire enumeration helper Update the driver to use the new core helper that waits for the device to enumerate on SoundWire and be initialised by the SoundWire core. Signed-off-by: Charles Keepax Link: https://patch.msgid.link/20260512103022.1154645-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/cs42l42-sdw.c b/sound/soc/codecs/cs42l42-sdw.c index d5999ad9ff9b4..b8256ce0b8fbe 100644 --- a/sound/soc/codecs/cs42l42-sdw.c +++ b/sound/soc/codecs/cs42l42-sdw.c @@ -433,19 +433,16 @@ static const struct reg_sequence cs42l42_soft_reboot_seq[] = { static int cs42l42_sdw_handle_unattach(struct cs42l42_private *cs42l42) { struct sdw_slave *peripheral = cs42l42->sdw_peripheral; + int ret; if (!peripheral->unattach_request) return 0; /* Cannot access registers until master re-attaches. */ dev_dbg(&peripheral->dev, "Wait for initialization_complete\n"); - if (!wait_for_completion_timeout(&peripheral->initialization_complete, - msecs_to_jiffies(5000))) { - dev_err(&peripheral->dev, "initialization_complete timed out\n"); - return -ETIMEDOUT; - } - - peripheral->unattach_request = 0; + ret = sdw_slave_wait_for_init(peripheral, 5000); + if (ret) + return ret; /* * After a bus reset there must be a reconfiguration reset to