Skip to content

Commit 9e07f8b

Browse files
harshimogalapallibroonie
authored andcommitted
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: fc918cb ("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
1 parent e041b85 commit 9e07f8b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/soc/codecs/cs42l43.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2205,7 +2205,8 @@ static int cs42l43_codec_probe(struct platform_device *pdev)
22052205
// Don't use devm as we need to get against the MFD device
22062206
priv->mclk = clk_get_optional(cs42l43->dev, "mclk");
22072207
if (IS_ERR(priv->mclk)) {
2208-
dev_err_probe(priv->dev, PTR_ERR(priv->mclk), "Failed to get mclk\n");
2208+
ret = PTR_ERR(priv->mclk);
2209+
dev_err_probe(priv->dev, ret, "Failed to get mclk\n");
22092210
goto err_pm;
22102211
}
22112212

0 commit comments

Comments
 (0)