Commit 24108993 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Sebastian Reichel

power: supply: ab8500_fg: Do not free non-requested IRQs in probe's error path

When requesting interrupt fails, free only interrupts already requested,
not all of them.
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent ccc023a5
...@@ -3165,7 +3165,7 @@ static int ab8500_fg_probe(struct platform_device *pdev) ...@@ -3165,7 +3165,7 @@ static int ab8500_fg_probe(struct platform_device *pdev)
if (ret != 0) { if (ret != 0) {
dev_err(di->dev, "failed to request %s IRQ %d: %d\n", dev_err(di->dev, "failed to request %s IRQ %d: %d\n",
ab8500_fg_irq_th[i].name, irq, ret); ab8500_fg_irq_th[i].name, irq, ret);
goto free_irq; goto free_irq_th;
} }
dev_dbg(di->dev, "Requested %s IRQ %d: %d\n", dev_dbg(di->dev, "Requested %s IRQ %d: %d\n",
ab8500_fg_irq_th[i].name, irq, ret); ab8500_fg_irq_th[i].name, irq, ret);
...@@ -3180,7 +3180,7 @@ static int ab8500_fg_probe(struct platform_device *pdev) ...@@ -3180,7 +3180,7 @@ static int ab8500_fg_probe(struct platform_device *pdev)
if (ret != 0) { if (ret != 0) {
dev_err(di->dev, "failed to request %s IRQ %d: %d\n", dev_err(di->dev, "failed to request %s IRQ %d: %d\n",
ab8500_fg_irq_bh[0].name, irq, ret); ab8500_fg_irq_bh[0].name, irq, ret);
goto free_irq; goto free_irq_th;
} }
dev_dbg(di->dev, "Requested %s IRQ %d: %d\n", dev_dbg(di->dev, "Requested %s IRQ %d: %d\n",
ab8500_fg_irq_bh[0].name, irq, ret); ab8500_fg_irq_bh[0].name, irq, ret);
...@@ -3222,7 +3222,9 @@ static int ab8500_fg_probe(struct platform_device *pdev) ...@@ -3222,7 +3222,9 @@ static int ab8500_fg_probe(struct platform_device *pdev)
/* We also have to free all registered irqs */ /* We also have to free all registered irqs */
irq = platform_get_irq_byname(pdev, ab8500_fg_irq_bh[0].name); irq = platform_get_irq_byname(pdev, ab8500_fg_irq_bh[0].name);
free_irq(irq, di); free_irq(irq, di);
for (i = 0; i < ARRAY_SIZE(ab8500_fg_irq_th); i++) { free_irq_th:
while (--i >= 0) {
/* Last assignment of i from primary interrupt handlers */
irq = platform_get_irq_byname(pdev, ab8500_fg_irq_th[i].name); irq = platform_get_irq_byname(pdev, ab8500_fg_irq_th[i].name);
free_irq(irq, di); free_irq(irq, di);
} }
......
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