[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240821092846.20138-6-liaoyuanhong@vivo.com>
Date: Wed, 21 Aug 2024 17:28:44 +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 5/7] rtc:rtc-sa1100:Use devm_clk_get_enabled() helpers
Use devm_clk_get_enabled() instead of clk functions in rtc-sa1100.
Signed-off-by: Liao Yuanhong <liaoyuanhong@...o.com>
---
drivers/rtc/rtc-sa1100.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c
index 0b2cfa8ca05b..2e72daa6a152 100644
--- a/drivers/rtc/rtc-sa1100.c
+++ b/drivers/rtc/rtc-sa1100.c
@@ -177,15 +177,12 @@ int sa1100_rtc_init(struct platform_device *pdev, struct sa1100_rtc *info)
spin_lock_init(&info->lock);
- info->clk = devm_clk_get(&pdev->dev, NULL);
+ info->clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(info->clk)) {
dev_err(&pdev->dev, "failed to find rtc clock source\n");
return PTR_ERR(info->clk);
}
- ret = clk_prepare_enable(info->clk);
- if (ret)
- return ret;
/*
* According to the manual we should be able to let RTTR be zero
* and then a default diviser for a 32.768KHz clock is used.
@@ -206,10 +203,8 @@ int sa1100_rtc_init(struct platform_device *pdev, struct sa1100_rtc *info)
info->rtc->range_max = U32_MAX;
ret = devm_rtc_register_device(info->rtc);
- if (ret) {
- clk_disable_unprepare(info->clk);
+ if (ret)
return ret;
- }
/* Fix for a nasty initialization problem the in SA11xx RTSR register.
* See also the comments in sa1100_rtc_interrupt().
@@ -305,7 +300,6 @@ static void sa1100_rtc_remove(struct platform_device *pdev)
spin_lock_irq(&info->lock);
writel_relaxed(0, info->rtsr);
spin_unlock_irq(&info->lock);
- clk_disable_unprepare(info->clk);
}
}
--
2.25.1
Powered by blists - more mailing lists