]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: cs42l51: Fix some error handling paths in cs42l51_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 26 Oct 2024 20:46:34 +0000 (22:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Nov 2024 15:25:52 +0000 (16:25 +0100)
commit720be854fb6ef7d1127b51d88e3262979b65919c
treeec9713bea99c6c3fd3e6329f995662e1fdd8b935
parent3f45d590ccbae6dfd6faef54efe74c30bd85d3da
ASoC: cs42l51: Fix some error handling paths in cs42l51_probe()

[ Upstream commit d221b844ee79823ffc29b7badc4010bdb0960224 ]

If devm_gpiod_get_optional() fails, we need to disable previously enabled
regulators, as done in the other error handling path of the function.

Also, gpiod_set_value_cansleep(, 1) needs to be called to undo a
potential gpiod_set_value_cansleep(, 0).
If the "reset" gpio is not defined, this additional call is just a no-op.

This behavior is the same as the one already in the .remove() function.

Fixes: 11b9cd748e31 ("ASoC: cs42l51: add reset management")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/a5e5f4b9fb03f46abd2c93ed94b5c395972ce0d1.1729975570.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/cs42l51.c