* [PATCH] ASoC: codecs: wcd939x-sdw: use devres for regmap allocation
@ 2025-12-01 9:22 Johan Hovold
2025-12-19 13:13 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Johan Hovold @ 2025-12-01 9:22 UTC (permalink / raw)
To: Srinivas Kandagatla, Mark Brown
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-arm-msm, linux-kernel, Johan Hovold, Neil Armstrong
Components are bound inside a new devres group so that any resources
allocated can be released on bind failure and on unbind without
affecting anything else.
Switch to using device managed regmap allocation for consistency while
dropping the misleading comment claiming that devres cannot be used.
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
sound/soc/codecs/wcd939x-sdw.c | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/sound/soc/codecs/wcd939x-sdw.c b/sound/soc/codecs/wcd939x-sdw.c
index da342a0c95a5..399dfba79aa2 100644
--- a/sound/soc/codecs/wcd939x-sdw.c
+++ b/sound/soc/codecs/wcd939x-sdw.c
@@ -1384,12 +1384,7 @@ static int wcd9390_probe(struct sdw_slave *pdev, const struct sdw_device_id *id)
}
if (wcd->is_tx) {
- /*
- * Do not use devres here since devres_release_group() could
- * be called by component_unbind() id the aggregate device
- * fails to bind.
- */
- wcd->regmap = regmap_init_sdw(pdev, &wcd939x_regmap_config);
+ wcd->regmap = devm_regmap_init_sdw(pdev, &wcd939x_regmap_config);
if (IS_ERR(wcd->regmap))
return dev_err_probe(dev, PTR_ERR(wcd->regmap),
"Regmap init failed\n");
@@ -1400,30 +1395,20 @@ static int wcd9390_probe(struct sdw_slave *pdev, const struct sdw_device_id *id)
ret = component_add(dev, &wcd_sdw_component_ops);
if (ret)
- goto err_free_regmap;
+ return ret;
/* Set suspended until aggregate device is bind */
pm_runtime_set_suspended(dev);
return 0;
-
-err_free_regmap:
- if (wcd->regmap)
- regmap_exit(wcd->regmap);
-
- return ret;
}
static int wcd9390_remove(struct sdw_slave *pdev)
{
struct device *dev = &pdev->dev;
- struct wcd939x_sdw_priv *wcd = dev_get_drvdata(dev);
component_del(dev, &wcd_sdw_component_ops);
- if (wcd->regmap)
- regmap_exit(wcd->regmap);
-
return 0;
}
--
2.51.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: codecs: wcd939x-sdw: use devres for regmap allocation
2025-12-01 9:22 [PATCH] ASoC: codecs: wcd939x-sdw: use devres for regmap allocation Johan Hovold
@ 2025-12-19 13:13 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-12-19 13:13 UTC (permalink / raw)
To: Srinivas Kandagatla, Johan Hovold
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-arm-msm, linux-kernel, Neil Armstrong
On Mon, 01 Dec 2025 10:22:59 +0100, Johan Hovold wrote:
> Components are bound inside a new devres group so that any resources
> allocated can be released on bind failure and on unbind without
> affecting anything else.
>
> Switch to using device managed regmap allocation for consistency while
> dropping the misleading comment claiming that devres cannot be used.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: codecs: wcd939x-sdw: use devres for regmap allocation
commit: 7a8447fc71a09000cee5a2372b6efde45735d2c8
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-19 13:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-01 9:22 [PATCH] ASoC: codecs: wcd939x-sdw: use devres for regmap allocation Johan Hovold
2025-12-19 13:13 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox