Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: codecs: msm8916-wcd-analog: Properly handle probe errors

The probe() function fails with an error for platform_get_irq_byname()
but only logs when devm_request_threaded_irq() fails. Make this
consistent and fail to probe in that case as well. In practice this
should never happen unless something is really wrong.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20230718-pm8916-mclk-v1-5-4b4a58b4240a@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Stephan Gerhold and committed by
Mark Brown
5c0f9652 97f29c1a

+9 -4
+9 -4
sound/soc/codecs/msm8916-wcd-analog.c
··· 1216 1216 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | 1217 1217 IRQF_ONESHOT, 1218 1218 "mbhc switch irq", priv); 1219 - if (ret) 1219 + if (ret) { 1220 1220 dev_err(dev, "cannot request mbhc switch irq\n"); 1221 + return ret; 1222 + } 1221 1223 1222 1224 if (priv->mbhc_btn_enabled) { 1223 1225 irq = platform_get_irq_byname(pdev, "mbhc_but_press_det"); ··· 1231 1229 IRQF_TRIGGER_RISING | 1232 1230 IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 1233 1231 "mbhc btn press irq", priv); 1234 - if (ret) 1232 + if (ret) { 1235 1233 dev_err(dev, "cannot request mbhc button press irq\n"); 1234 + return ret; 1235 + } 1236 1236 1237 1237 irq = platform_get_irq_byname(pdev, "mbhc_but_rel_det"); 1238 1238 if (irq < 0) ··· 1245 1241 IRQF_TRIGGER_RISING | 1246 1242 IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 1247 1243 "mbhc btn release irq", priv); 1248 - if (ret) 1244 + if (ret) { 1249 1245 dev_err(dev, "cannot request mbhc button release irq\n"); 1250 - 1246 + return ret; 1247 + } 1251 1248 } 1252 1249 1253 1250 dev_set_drvdata(dev, priv);