* [PATCH] ASoC: sun4i-spdif: Make reset control non-optional and check for all errors
@ 2026-03-23 17:24 Chen-Yu Tsai
2026-03-23 23:50 ` Jernej Škrabec
2026-03-24 0:12 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Chen-Yu Tsai @ 2026-03-23 17:24 UTC (permalink / raw)
To: Philipp Zabel, Mark Brown, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland
Cc: Chen-Yu Tsai, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-sunxi, linux-arm-kernel, linux-kernel
From: Chen-Yu Tsai <wens@csie.org>
The logic around the reset control is weird. The driver already has
quirks describing which compatible strings require a reset control, but
the reset control is acquired using the "optional" API. Then any errors
other than deferred probe are ignored.
Instead, switch to the non-optional variant. Also use the deassered
variant to simplify the code. This also fixes a missing reset assert
upon removal.
Last, clean up the error message printing with dev_err_probe().
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
sound/soc/sunxi/sun4i-spdif.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
index 65de03ca3ad2..c2ec19437cd7 100644
--- a/sound/soc/sunxi/sun4i-spdif.c
+++ b/sound/soc/sunxi/sun4i-spdif.c
@@ -712,15 +712,10 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, host);
if (quirks->has_reset) {
- host->rst = devm_reset_control_get_optional_exclusive(&pdev->dev,
- NULL);
- if (PTR_ERR(host->rst) == -EPROBE_DEFER) {
- ret = -EPROBE_DEFER;
- dev_err(&pdev->dev, "Failed to get reset: %d\n", ret);
- return ret;
- }
- if (!IS_ERR(host->rst))
- reset_control_deassert(host->rst);
+ host->rst = devm_reset_control_get_exclusive_deasserted(&pdev->dev, NULL);
+ if (IS_ERR(host->rst))
+ return dev_err_probe(&pdev->dev, PTR_ERR(host->rst),
+ "Failed to get reset\n");
}
ret = devm_snd_soc_register_component(&pdev->dev,
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: sun4i-spdif: Make reset control non-optional and check for all errors
2026-03-23 17:24 [PATCH] ASoC: sun4i-spdif: Make reset control non-optional and check for all errors Chen-Yu Tsai
@ 2026-03-23 23:50 ` Jernej Škrabec
2026-03-24 0:12 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Jernej Škrabec @ 2026-03-23 23:50 UTC (permalink / raw)
To: Philipp Zabel, Mark Brown, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Chen-Yu Tsai
Cc: Chen-Yu Tsai, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-sunxi, linux-arm-kernel, linux-kernel
Dne ponedeljek, 23. marec 2026 ob 18:24:48 Srednjeevropski standardni čas je Chen-Yu Tsai napisal(a):
> From: Chen-Yu Tsai <wens@csie.org>
>
> The logic around the reset control is weird. The driver already has
> quirks describing which compatible strings require a reset control, but
> the reset control is acquired using the "optional" API. Then any errors
> other than deferred probe are ignored.
>
> Instead, switch to the non-optional variant. Also use the deassered
> variant to simplify the code. This also fixes a missing reset assert
> upon removal.
>
> Last, clean up the error message printing with dev_err_probe().
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: sun4i-spdif: Make reset control non-optional and check for all errors
2026-03-23 17:24 [PATCH] ASoC: sun4i-spdif: Make reset control non-optional and check for all errors Chen-Yu Tsai
2026-03-23 23:50 ` Jernej Škrabec
@ 2026-03-24 0:12 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-03-24 0:12 UTC (permalink / raw)
To: Philipp Zabel, Jernej Skrabec, Samuel Holland, Chen-Yu Tsai
Cc: Jaroslav Kysela, Takashi Iwai, linux-sound, linux-sunxi,
linux-arm-kernel, linux-kernel, Chen-Yu Tsai
On Tue, 24 Mar 2026 01:24:48 +0800, Chen-Yu Tsai wrote:
> ASoC: sun4i-spdif: Make reset control non-optional and check for all errors
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1
Thanks!
[1/1] ASoC: sun4i-spdif: Make reset control non-optional and check for all errors
https://git.kernel.org/broonie/sound/c/51b0909d0bc4
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] 3+ messages in thread
end of thread, other threads:[~2026-03-24 0:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23 17:24 [PATCH] ASoC: sun4i-spdif: Make reset control non-optional and check for all errors Chen-Yu Tsai
2026-03-23 23:50 ` Jernej Škrabec
2026-03-24 0:12 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox