summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>2023-08-29 09:36:35 +0200
committerMark Brown <broonie@kernel.org>2023-08-29 12:21:05 +0200
commit9e07f8bfd959d2d09823430eab35d12182446dcf (patch)
tree0fc3e0ecb34cb3df9ef6f4c7358d9a2cb2e3aea8 /sound/soc
parentASoC: cs35l45: Rename DACPCM1 Source control (diff)
downloadlinux-9e07f8bfd959d2d09823430eab35d12182446dcf.tar.xz
linux-9e07f8bfd959d2d09823430eab35d12182446dcf.zip
ASoC: cs42l43: Fix missing error code in cs42l43_codec_probe()
When clk_get_optional() fails, the error handling code does a 'goto err_pm' with ret = 0, which is resturning success on a failure path. Fix this by assigning the PTR_ERR(priv-mclk) to ret variable. Fixes: fc918cbe874e ("ASoC: cs42l43: Add support for the cs42l43") Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com Link: https://lore.kernel.org/r/20230829073635.1877367-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Mark Brown <broonie@kernel.org
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/cs42l43.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/cs42l43.c b/sound/soc/codecs/cs42l43.c
index 24e718e51174..1a95c370fc4c 100644
--- a/sound/soc/codecs/cs42l43.c
+++ b/sound/soc/codecs/cs42l43.c
@@ -2205,7 +2205,8 @@ static int cs42l43_codec_probe(struct platform_device *pdev)
// Don't use devm as we need to get against the MFD device
priv->mclk = clk_get_optional(cs42l43->dev, "mclk");
if (IS_ERR(priv->mclk)) {
- dev_err_probe(priv->dev, PTR_ERR(priv->mclk), "Failed to get mclk\n");
+ ret = PTR_ERR(priv->mclk);
+ dev_err_probe(priv->dev, ret, "Failed to get mclk\n");
goto err_pm;
}