[PATCH 02/17] ASoC: cs42l42: Use new SoundWire enumeration helper

Charles Keepax
2026-05-05T16:48:52Z

sound/soc/codecs/cs42l42-sdw.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/sound/soc/codecs/cs42l42-sdw.c b/sound/soc/codecs/cs42l42-sdw.c
index d5999ad9ff9b4..ef030d0ddce94 100644
--- a/sound/soc/codecs/cs42l42-sdw.c
+++ b/sound/soc/codecs/cs42l42-sdw.c
@@ -433,19 +433,12 @@ 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;
-
- if (!peripheral->unattach_request)
- return 0;
+ int ret;

/* 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
--
2.47.3