[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240829072209.7253-5-liaoyuanhong@vivo.com>
Date: Thu, 29 Aug 2024 15:22:06 +0800
From: Liao Yuanhong <liaoyuanhong@...o.com>
To: alexandre.belloni@...tlin.com
Cc: linux-rtc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Liao Yuanhong <liaoyuanhong@...o.com>
Subject: [PATCH v2 4/7] rtc:rtc-s3c:Use devm_clk_get_enabled() helpers
Use devm_clk_get_enabled() instead of clk functions in rtc-s3c.
Signed-off-by: Liao Yuanhong <liaoyuanhong@...o.com>
---
drivers/rtc/rtc-s3c.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 282238818f63..ecceffee7118 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -425,24 +425,18 @@ static int s3c_rtc_probe(struct platform_device *pdev)
if (IS_ERR(info->base))
return PTR_ERR(info->base);
- info->rtc_clk = devm_clk_get(&pdev->dev, "rtc");
+ info->rtc_clk = devm_clk_get_enabled(&pdev->dev, "rtc");
if (IS_ERR(info->rtc_clk))
return dev_err_probe(&pdev->dev, PTR_ERR(info->rtc_clk),
"failed to find rtc clock\n");
- ret = clk_prepare_enable(info->rtc_clk);
- if (ret)
- return ret;
if (info->data->needs_src_clk) {
- info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src");
+ info->rtc_src_clk = devm_clk_get_enabled(&pdev->dev, "rtc_src");
if (IS_ERR(info->rtc_src_clk)) {
ret = dev_err_probe(&pdev->dev, PTR_ERR(info->rtc_src_clk),
"failed to find rtc source clock\n");
- goto err_src_clk;
+ return ret;
}
- ret = clk_prepare_enable(info->rtc_src_clk);
- if (ret)
- goto err_src_clk;
}
/* disable RTC enable bits potentially set by the bootloader */
@@ -487,11 +481,6 @@ static int s3c_rtc_probe(struct platform_device *pdev)
if (info->data->disable)
info->data->disable(info);
- if (info->data->needs_src_clk)
- clk_disable_unprepare(info->rtc_src_clk);
-err_src_clk:
- clk_disable_unprepare(info->rtc_clk);
-
return ret;
}
--
2.25.1
Powered by blists - more mailing lists