[PATCH] ASoC: pxa-ssp: Release the SSP port when clock lookup fails

Zhu Jun zhujun2 at cmss.chinamobile.com
Wed Nov 11 23:17:57 PST 2026


pxa_ssp_probe() reserves the SSP port before looking up extclk. If the
clock lookup returns an error such as -EPROBE_DEFER, the private data
is freed but the port remains reserved. A later probe attempt cannot
request that port and fails with -ENODEV.

Release the reserved SSP port before the existing private-data cleanup
when the optional clock lookup fails.

Fixes: 90eb6b59d311 ("ASoC: pxa-ssp: add support for an external clock in devicetree")
Signed-off-by: Zhu Jun <zhujun2 at cmss.chinamobile.com>
---
 sound/soc/pxa/pxa-ssp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index 9a98246ad19c..53682c9f2ccc 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -772,6 +772,7 @@ static int pxa_ssp_probe(struct snd_soc_dai *dai)
 		priv->extclk = devm_clk_get_optional(dev, "extclk");
 		if (IS_ERR(priv->extclk)) {
 			ret = PTR_ERR(priv->extclk);
+			pxa_ssp_free(priv->ssp);
 			goto err_priv;
 		}
 	} else {
-- 
2.51.0






More information about the linux-arm-kernel mailing list