Re: [PATCH v2 2/2] mfd: cs42l43: Move to core detach helper
From: Lee Jones
Date: Wed Sep 16 2026 - 11:36:57 EST
On Mon, 31 Aug 2026, Charles Keepax wrote:
> Now the core has a helper to signal a device will detach from
> the SoundWire bus, there is no need for the cs42l43 driver code
> to separately track that. Switch to using the new core helper.
>
> Signed-off-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
> ---
>
> No changes since v1.
>
> drivers/mfd/cs42l43-sdw.c | 2 --
> drivers/mfd/cs42l43.c | 15 +--------------
> include/linux/mfd/cs42l43.h | 1 -
> 3 files changed, 1 insertion(+), 17 deletions(-)
>
> diff --git a/drivers/mfd/cs42l43-sdw.c b/drivers/mfd/cs42l43-sdw.c
> index 0a6999453f325..f0825d6bf7b38 100644
> --- a/drivers/mfd/cs42l43-sdw.c
> +++ b/drivers/mfd/cs42l43-sdw.c
> @@ -102,8 +102,6 @@ static int cs42l43_sdw_update_status(struct sdw_slave *sdw, enum sdw_slave_statu
> break;
> case SDW_SLAVE_UNATTACHED:
> dev_dbg(cs42l43->dev, "Device detach\n");
Is this now superfluous?
> -
> - complete(&cs42l43->device_detach);
> break;
> default:
> break;
> diff --git a/drivers/mfd/cs42l43.c b/drivers/mfd/cs42l43.c
> index 4212ebcca60b5..f08ee598366d9 100644
> --- a/drivers/mfd/cs42l43.c
> +++ b/drivers/mfd/cs42l43.c
> @@ -30,7 +30,6 @@
> #define CS42L43_RESET_DELAY_MS 20
>
> #define CS42L43_SDW_ATTACH_TIMEOUT_MS 5000
> -#define CS42L43_SDW_DETACH_TIMEOUT_MS 100
>
> #define CS42L43_MCU_BOOT_STAGE1 1
> #define CS42L43_MCU_BOOT_STAGE2 2
> @@ -555,7 +554,7 @@ static int cs42l43_soft_reset(struct cs42l43 *cs42l43)
> { CS42L43_SFT_RESET, CS42L43_SFT_RESET_VAL },
> };
>
> - reinit_completion(&cs42l43->device_detach);
> + sdw_slave_signal_unattach(cs42l43->sdw);
If this call NULL safe?
> /*
> * Apply cache only because the soft reset will cause the device to
> @@ -566,17 +565,6 @@ static int cs42l43_soft_reset(struct cs42l43 *cs42l43)
>
> msleep(CS42L43_RESET_DELAY_MS);
>
> - if (cs42l43->sdw) {
> - unsigned long timeout = msecs_to_jiffies(CS42L43_SDW_DETACH_TIMEOUT_MS);
> - unsigned long time;
> -
> - time = wait_for_completion_timeout(&cs42l43->device_detach, timeout);
> - if (!time) {
> - dev_err(cs42l43->dev, "Timed out waiting for device detach\n");
> - return -ETIMEDOUT;
> - }
> - }
> -
> return -EAGAIN;
> }
>
> @@ -1115,7 +1103,6 @@ int cs42l43_dev_probe(struct cs42l43 *cs42l43)
> dev_set_drvdata(cs42l43->dev, cs42l43);
>
> mutex_init(&cs42l43->pll_lock);
> - init_completion(&cs42l43->device_detach);
> init_completion(&cs42l43->firmware_download);
> INIT_WORK(&cs42l43->boot_work, cs42l43_boot_work);
>
> diff --git a/include/linux/mfd/cs42l43.h b/include/linux/mfd/cs42l43.h
> index 8e993fb535e68..798dc55149662 100644
> --- a/include/linux/mfd/cs42l43.h
> +++ b/include/linux/mfd/cs42l43.h
> @@ -86,7 +86,6 @@ struct cs42l43 {
> struct regmap_irq_chip_data *irq_data;
>
> struct work_struct boot_work;
> - struct completion device_detach;
> struct completion firmware_download;
> int firmware_error;
>
> --
> 2.47.3
>
--
Lee Jones