]> www.infradead.org Git - users/dwmw2/linux.git/commit
ASoC: codecs: wcd939x: Fix typec mux and switch leak during device removal
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 1 Jul 2024 12:26:16 +0000 (14:26 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 4 Jul 2024 11:42:24 +0000 (12:42 +0100)
commit9f3ae72c5dbca9ba558c752f1ef969ed6908be01
tree4607196d55ffdc46f5433042d0e3f67441b255a8
parent1e0dff741b0a8af35645e5c3ffc4050893002a9c
ASoC: codecs: wcd939x: Fix typec mux and switch leak during device removal

Driver does not unregister typec structures (typec_mux_dev and
typec_switch_desc) during removal leading to leaks.  Fix this by moving
typec registering parts to separate function and using devm interface to
release them.  This also makes code a bit simpler:
 - Smaller probe() function with less error paths and no #ifdefs,
 - No need to store typec_mux_dev and typec_switch_desc in driver state
   container structure.

Cc: stable@vger.kernel.org
Fixes: 10f514bd172a ("ASoC: codecs: Add WCD939x Codec driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20240701122616.414158-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wcd939x.c