From: Qinglang Miao <miaoqingl...@huawei.com>

commit 560c6b914c6ec7d9d9a69fddbb5bf3bf71433e8b upstream.

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.

Suggested-by: Robin Murphy <robin.mur...@arm.com>
Fixes: 44d6f2ef94f9 ("iio: adc: add driver for Rockchip saradc")
Signed-off-by: Qinglang Miao <miaoqingl...@huawei.com>
Cc: <sta...@vger.kernel.org>
Link: https://lore.kernel.org/r/20201103120743.110662-1-miaoqingl...@huawei.com
Signed-off-by: Jonathan Cameron <jonathan.came...@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

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

--- a/drivers/iio/adc/rockchip_saradc.c
+++ b/drivers/iio/adc/rockchip_saradc.c
@@ -383,7 +383,7 @@ static int rockchip_saradc_resume(struct
 
        ret = clk_prepare_enable(info->clk);
        if (ret)
-               return ret;
+               clk_disable_unprepare(info->pclk);
 
        return ret;
 }


Reply via email to