[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1511315892.275533259@decadent.org.uk>
Date: Wed, 22 Nov 2017 01:58:12 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, "Johan Hovold" <johan@...nel.org>,
"Thierry Reding" <thierry.reding@...il.com>
Subject: [PATCH 3.16 047/133] pwm: tiehrpwm: fix clock imbalance in probe
error path
3.16.51-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@...nel.org>
commit e2b5602af76dec75f474e4173afb4215007ecfa5 upstream.
Make sure to unprepare the clock before returning on late probe errors.
Fixes: b388f15fd14c ("pwm: pwm-tiehrpwm: Use clk_enable/disable instead clk_prepare/unprepare.")
Signed-off-by: Johan Hovold <johan@...nel.org>
Signed-off-by: Thierry Reding <thierry.reding@...il.com>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
--- a/drivers/pwm/pwm-tiehrpwm.c
+++ b/drivers/pwm/pwm-tiehrpwm.c
@@ -483,7 +483,7 @@ static int ehrpwm_pwm_probe(struct platf
ret = pwmchip_add(&pc->chip);
if (ret < 0) {
dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
- return ret;
+ goto err_clk_unprepare;
}
pm_runtime_enable(&pdev->dev);
@@ -506,7 +506,9 @@ pwmss_clk_failure:
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pwmchip_remove(&pc->chip);
+err_clk_unprepare:
clk_unprepare(pc->tbclk);
+
return ret;
}
Powered by blists - more mailing lists