linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume
@ 2020-11-03 12:07 Qinglang Miao
  2020-11-08 15:41 ` Jonathan Cameron
  0 siblings, 1 reply; 7+ messages in thread
From: Qinglang Miao @ 2020-11-03 12:07 UTC (permalink / raw)
  To: Robin Murphy, Jonathan Cameron, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Heiko Stuebner
  Cc: linux-iio, linux-arm-kernel, linux-rockchip, linux-kernel,
	Qinglang Miao

Fix the missing clk_disable_unprepare() of info->pclk
before return from rockchip_saradc_resume in the error
handling case when fails to prepare and enable info->clk.

Fixes: 44d6f2ef94f9 ("iio: adc: add driver for Rockchip saradc")
Suggested-by:Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
v2: remove useless braces because early return is pointless.

 drivers/iio/adc/rockchip_saradc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
index 1f3d7d639..12584f163 100644
--- a/drivers/iio/adc/rockchip_saradc.c
+++ b/drivers/iio/adc/rockchip_saradc.c
@@ -462,7 +462,7 @@ static int rockchip_saradc_resume(struct device *dev)
 
 	ret = clk_prepare_enable(info->clk);
 	if (ret)
-		return ret;
+		clk_disable_unprepare(info->pclk);
 
 	return ret;
 }
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH v2] iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume
@ 2020-11-03  7:49 Qinglang Miao
  2020-11-03  8:20 ` Qinglang Miao
  2020-11-03 11:11 ` Robin Murphy
  0 siblings, 2 replies; 7+ messages in thread
From: Qinglang Miao @ 2020-11-03  7:49 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Heiko Stuebner
  Cc: linux-iio, linux-arm-kernel, linux-rockchip, linux-kernel,
	Qinglang Miao

Fix the missing clk_disable_unprepare() of info->pclk
before return from rockchip_saradc_resume in the error
handling case when fails to prepare and enable info->clk.

Fixes: 44d6f2ef94f9 ("iio: adc: add driver for Rockchip saradc")
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 drivers/iio/adc/rockchip_saradc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
index 1f3d7d639..5eb566274 100644
--- a/drivers/iio/adc/rockchip_saradc.c
+++ b/drivers/iio/adc/rockchip_saradc.c
@@ -461,9 +461,10 @@ static int rockchip_saradc_resume(struct device *dev)
 		return ret;
 
 	ret = clk_prepare_enable(info->clk);
-	if (ret)
+	if (ret) {
+		clk_disable_unprepare(info->pclk);
 		return ret;
-
+	}
 	return ret;
 }
 #endif
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-21 16:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-03 12:07 [PATCH v2] iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume Qinglang Miao
2020-11-08 15:41 ` Jonathan Cameron
2020-11-21 16:39   ` Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2020-11-03  7:49 Qinglang Miao
2020-11-03  8:20 ` Qinglang Miao
2020-11-03 11:11 ` Robin Murphy
2020-11-03 12:04   ` Qinglang Miao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).