]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: tas2562: fix deprecated 'shut-down' GPIO always cleared after lookup
authorUday Khare <udaykhare77@gmail.com>
Mon, 6 Jul 2026 15:31:09 +0000 (21:01 +0530)
committerMark Brown <broonie@kernel.org>
Wed, 8 Jul 2026 23:33:20 +0000 (00:33 +0100)
commit3238c634725afbb2a137fdda762208510828f71d
tree75cf7c1a608b384f5221cc0522858a7c28f8c89a
parentf74e6e15485b68b92b2807071e822db6309b7e38
ASoC: tas2562: fix deprecated 'shut-down' GPIO always cleared after lookup

In tas2562_parse_dt(), the fallback lookup for the deprecated
"shut-down" GPIO property is broken due to a missing pair of braces.

The code intends to reset sdz_gpio to NULL only when the lookup
returns an error that is not -EPROBE_DEFER (so the driver gracefully
continues without a GPIO). However, without braces the statement:

    tas2562->sdz_gpio = NULL;

falls outside the IS_ERR() check and is executed unconditionally
for every path through the if block, including a successful GPIO
lookup.

This means any device using the deprecated 'shut-down' DT property
will always have sdz_gpio == NULL after probe, making the GPIO
completely non-functional.

Fix this by adding the missing braces to scope the NULL assignment
inside the IS_ERR() branch, matching the pattern already used for
the primary 'shutdown' GPIO lookup above.

Fixes: f78a97003b8b ("ASoC: tas2562: Update shutdown GPIO property")
Signed-off-by: Uday Khare <udaykhare77@gmail.com>
Link: https://patch.msgid.link/20260706153109.10953-1-udaykhare77@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas2562.c