Commit fba5b1e9 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

regmap-irq: Correct error paths in regmap_irq_thread for pm_runtime

Some error paths in regmap_irq_thread put the pm_runtime others do not,
there is no reason to leave the pm_runtime enabled in some cases so
update those paths to also put the pm_runtime.
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20190812092409.21593-1-ckeepax@opensource.cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5f9e832c
...@@ -370,7 +370,6 @@ static irqreturn_t regmap_irq_thread(int irq, void *d) ...@@ -370,7 +370,6 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
if (ret < 0) { if (ret < 0) {
dev_err(map->dev, "IRQ thread failed to resume: %d\n", dev_err(map->dev, "IRQ thread failed to resume: %d\n",
ret); ret);
pm_runtime_put(map->dev);
goto exit; goto exit;
} }
} }
...@@ -425,8 +424,6 @@ static irqreturn_t regmap_irq_thread(int irq, void *d) ...@@ -425,8 +424,6 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
dev_err(map->dev, dev_err(map->dev,
"Failed to read IRQ status %d\n", "Failed to read IRQ status %d\n",
ret); ret);
if (chip->runtime_pm)
pm_runtime_put(map->dev);
goto exit; goto exit;
} }
} }
...@@ -478,8 +475,6 @@ static irqreturn_t regmap_irq_thread(int irq, void *d) ...@@ -478,8 +475,6 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
dev_err(map->dev, dev_err(map->dev,
"Failed to read IRQ status: %d\n", "Failed to read IRQ status: %d\n",
ret); ret);
if (chip->runtime_pm)
pm_runtime_put(map->dev);
goto exit; goto exit;
} }
} }
...@@ -513,10 +508,10 @@ static irqreturn_t regmap_irq_thread(int irq, void *d) ...@@ -513,10 +508,10 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
} }
} }
exit:
if (chip->runtime_pm) if (chip->runtime_pm)
pm_runtime_put(map->dev); pm_runtime_put(map->dev);
exit:
if (chip->handle_post_irq) if (chip->handle_post_irq)
chip->handle_post_irq(chip->irq_drv_data); chip->handle_post_irq(chip->irq_drv_data);
......
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