Commit 557244f6 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Lee Jones

mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init()

In lp8788_irq_init(), if an error occurs after a successful
irq_domain_add_linear() call, it must be undone by a corresponding
irq_domain_remove() call.

irq_domain_remove() should also be called in lp8788_irq_exit() for the same
reason.

Fixes: eea6b7cc ("mfd: Add lp8788 mfd driver")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarLee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/bcd5a72c9c1c383dd6324680116426e32737655a.1659261275.git.christophe.jaillet@wanadoo.fr
parent becfdcd7
...@@ -175,6 +175,7 @@ int lp8788_irq_init(struct lp8788 *lp, int irq) ...@@ -175,6 +175,7 @@ int lp8788_irq_init(struct lp8788 *lp, int irq)
IRQF_TRIGGER_FALLING | IRQF_ONESHOT, IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
"lp8788-irq", irqd); "lp8788-irq", irqd);
if (ret) { if (ret) {
irq_domain_remove(lp->irqdm);
dev_err(lp->dev, "failed to create a thread for IRQ_N\n"); dev_err(lp->dev, "failed to create a thread for IRQ_N\n");
return ret; return ret;
} }
...@@ -188,4 +189,6 @@ void lp8788_irq_exit(struct lp8788 *lp) ...@@ -188,4 +189,6 @@ void lp8788_irq_exit(struct lp8788 *lp)
{ {
if (lp->irq) if (lp->irq)
free_irq(lp->irq, lp->irqdm); free_irq(lp->irq, lp->irqdm);
if (lp->irqdm)
irq_domain_remove(lp->irqdm);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment