Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: sun4i-spdif: Make reset control non-optional and check for all errors

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>
Link: https://patch.msgid.link/20260323172450.1259111-1-wens@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Chen-Yu Tsai and committed by
Mark Brown
51b0909d 1001b473

+4 -9
+4 -9
sound/soc/sunxi/sun4i-spdif.c
··· 712 712 platform_set_drvdata(pdev, host); 713 713 714 714 if (quirks->has_reset) { 715 - host->rst = devm_reset_control_get_optional_exclusive(&pdev->dev, 716 - NULL); 717 - if (PTR_ERR(host->rst) == -EPROBE_DEFER) { 718 - ret = -EPROBE_DEFER; 719 - dev_err(&pdev->dev, "Failed to get reset: %d\n", ret); 720 - return ret; 721 - } 722 - if (!IS_ERR(host->rst)) 723 - reset_control_deassert(host->rst); 715 + host->rst = devm_reset_control_get_exclusive_deasserted(&pdev->dev, NULL); 716 + if (IS_ERR(host->rst)) 717 + return dev_err_probe(&pdev->dev, PTR_ERR(host->rst), 718 + "Failed to get reset\n"); 724 719 } 725 720 726 721 ret = devm_snd_soc_register_component(&pdev->dev,