[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210726140001.24820-2-nikita.shubin@maquefel.me>
Date: Mon, 26 Jul 2021 16:59:49 +0300
From: Nikita Shubin <nikita.shubin@...uefel.me>
To: Alexander Sverdlin <alexander.sverdlin@...il.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Nikita Shubin <nikita.shubin@...uefel.me>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
linux-iio@...r.kernel.org (open list:IIO SUBSYSTEM AND DRIVERS),
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH v2 1/8] iio: ep93xx: Prepare clock before using it
From: Alexander Sverdlin <alexander.sverdlin@...il.com>
Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
to Common Clock Framework, otherwise the following is visible:
WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc
Enabling unprepared ep93xx-adc
...
Hardware name: Cirrus Logic EDB9302 Evaluation Board
unwind_backtrace) from [<c000c590>] (show_stack+0x10/0x18)
...
clk_core_enable
clk_core_enable_lock
ep93xx_adc_probe
...
ep93xx-adc ep93xx-adc: Cannot enable clock
ep93xx-adc: probe of ep93xx-adc failed with error -108
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@...il.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Signed-off-by: Nikita Shubin <nikita.shubin@...uefel.me>
---
drivers/iio/adc/ep93xx_adc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/adc/ep93xx_adc.c b/drivers/iio/adc/ep93xx_adc.c
index c08ab3c6dfaf..5c85257b814c 100644
--- a/drivers/iio/adc/ep93xx_adc.c
+++ b/drivers/iio/adc/ep93xx_adc.c
@@ -207,7 +207,7 @@ static int ep93xx_adc_probe(struct platform_device *pdev)
*/
}
- ret = clk_enable(priv->clk);
+ ret = clk_prepare_enable(priv->clk);
if (ret) {
dev_err(&pdev->dev, "Cannot enable clock\n");
return ret;
@@ -215,7 +215,7 @@ static int ep93xx_adc_probe(struct platform_device *pdev)
ret = iio_device_register(iiodev);
if (ret)
- clk_disable(priv->clk);
+ clk_disable_unprepare(priv->clk);
return ret;
}
@@ -226,7 +226,7 @@ static int ep93xx_adc_remove(struct platform_device *pdev)
struct ep93xx_adc_priv *priv = iio_priv(iiodev);
iio_device_unregister(iiodev);
- clk_disable(priv->clk);
+ clk_disable_unprepare(priv->clk);
return 0;
}
base-commit: 64376a981a0e2e57c46efa63197c2ebb7dab35df
--
2.26.2
Powered by blists - more mailing lists