[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240821092846.20138-5-liaoyuanhong@vivo.com>
Date: Wed, 21 Aug 2024 17:28:43 +0800
From: Liao Yuanhong <liaoyuanhong@...o.com>
To: alexandre.belloni@...tlin.com,
linux-rtc@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Liao Yuanhong <liaoyuanhong@...o.com>
Subject: [PATCH 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 | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 282238818f63..dd6a72b999e1 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 */
@@ -486,13 +480,6 @@ static int s3c_rtc_probe(struct platform_device *pdev)
err_nortc:
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;
}
#ifdef CONFIG_PM_SLEEP
--
2.25.1
Powered by blists - more mailing lists