Skip to content

Commit cfe267d

Browse files
GustavoARSilvabroonie
authored andcommitted
ASoC: twl6040: fix error return code in twl6040_probe()
platform_get_irq() returns an error code, but the twl6040 driver ignores it and always returns -EINVAL. This is not correct, and prevents -EPROBE_DEFER from being propagated properly. Notice that platform_get_irq() no longer returns 0 on error. Print and propagate the return value of platform_get_irq on failure. Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 5771a8c commit cfe267d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/codecs/twl6040.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,8 +1123,8 @@ static int twl6040_probe(struct snd_soc_codec *codec)
11231123

11241124
priv->plug_irq = platform_get_irq(pdev, 0);
11251125
if (priv->plug_irq < 0) {
1126-
dev_err(codec->dev, "invalid irq\n");
1127-
return -EINVAL;
1126+
dev_err(codec->dev, "invalid irq: %d\n", priv->plug_irq);
1127+
return priv->plug_irq;
11281128
}
11291129

11301130
INIT_DELAYED_WORK(&priv->hs_jack.work, twl6040_accessory_work);

0 commit comments

Comments
 (0)