From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Liao Yuanhong <liaoyuanhong@vivo.com>,
alexandre.belloni@bootlin.com, linux-rtc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/7] rtc:rtc-mt7622:Use devm_clk_get_enabled() helpers
Date: Wed, 21 Aug 2024 13:25:05 +0200 [thread overview]
Message-ID: <a2724a97-e253-4ef3-a76f-d57294bf3060@wanadoo.fr> (raw)
In-Reply-To: <20240821092846.20138-4-liaoyuanhong@vivo.com>
Le 21/08/2024 à 11:28, Liao Yuanhong a écrit :
> Use devm_clk_get_enabled() instead of clk functions in rtc-mt7622.
>
> Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
> ---
> drivers/rtc/rtc-mt7622.c | 24 ++++--------------------
> 1 file changed, 4 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/rtc/rtc-mt7622.c b/drivers/rtc/rtc-mt7622.c
> index 094c649fc137..da1d9652d6da 100644
> --- a/drivers/rtc/rtc-mt7622.c
> +++ b/drivers/rtc/rtc-mt7622.c
> @@ -315,27 +315,23 @@ static int mtk_rtc_probe(struct platform_device *pdev)
> if (IS_ERR(hw->base))
> return PTR_ERR(hw->base);
>
> - hw->clk = devm_clk_get(&pdev->dev, "rtc");
> + hw->clk = devm_clk_get_enabled(&pdev->dev, "rtc");
Hi,
the clk field in struct mtk_rtc could also be easily removed now.
CJ
> if (IS_ERR(hw->clk)) {
> dev_err(&pdev->dev, "No clock\n");
> return PTR_ERR(hw->clk);
> }
>
> - ret = clk_prepare_enable(hw->clk);
> - if (ret)
> - return ret;
> -
> hw->irq = platform_get_irq(pdev, 0);
> if (hw->irq < 0) {
> ret = hw->irq;
> - goto err;
> + return ret;
> }
>
> ret = devm_request_irq(&pdev->dev, hw->irq, mtk_rtc_alarmirq,
> 0, dev_name(&pdev->dev), hw);
> if (ret) {
> dev_err(&pdev->dev, "Can't request IRQ\n");
> - goto err;
> + return ret;
> }
>
> mtk_rtc_hw_init(hw);
> @@ -347,21 +343,10 @@ static int mtk_rtc_probe(struct platform_device *pdev)
> if (IS_ERR(hw->rtc)) {
> ret = PTR_ERR(hw->rtc);
> dev_err(&pdev->dev, "Unable to register device\n");
> - goto err;
> + return ret;
> }
>
> return 0;
> -err:
> - clk_disable_unprepare(hw->clk);
> -
> - return ret;
> -}
> -
> -static void mtk_rtc_remove(struct platform_device *pdev)
> -{
> - struct mtk_rtc *hw = platform_get_drvdata(pdev);
> -
> - clk_disable_unprepare(hw->clk);
> }
>
> #ifdef CONFIG_PM_SLEEP
> @@ -394,7 +379,6 @@ static SIMPLE_DEV_PM_OPS(mtk_rtc_pm_ops, mtk_rtc_suspend, mtk_rtc_resume);
>
> static struct platform_driver mtk_rtc_driver = {
> .probe = mtk_rtc_probe,
> - .remove_new = mtk_rtc_remove,
> .driver = {
> .name = MTK_RTC_DEV,
> .of_match_table = mtk_rtc_match,
next prev parent reply other threads:[~2024-08-21 11:26 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 9:28 [PATCH 0/7] rtc:Use " Liao Yuanhong
2024-08-21 9:28 ` [PATCH 1/7] rtc:rtc-at91rm9200:Use " Liao Yuanhong
2024-08-21 11:22 ` Christophe JAILLET
2024-08-22 3:24 ` kernel test robot
2024-08-22 3:24 ` kernel test robot
2024-08-22 3:37 ` [PATCH v3 " Liao Yuanhong
2024-08-23 9:01 ` [PATCH " kernel test robot
2024-08-23 9:11 ` kernel test robot
2024-08-21 9:28 ` [PATCH 2/7] rtc:rtc-imxdi:Use " Liao Yuanhong
2024-08-22 2:44 ` [PATCH] rtc:rtc-at91rm9200:Use " Liao Yuanhong
2024-08-21 9:28 ` [PATCH 3/7] rtc:rtc-mt7622:Use " Liao Yuanhong
2024-08-21 11:25 ` Christophe JAILLET [this message]
2024-08-22 2:57 ` [PATCH v2 " Liao Yuanhong
2024-08-21 9:28 ` [PATCH 4/7] rtc:rtc-s3c:Use " Liao Yuanhong
2024-08-22 5:07 ` kernel test robot
2024-08-22 6:50 ` [PATCH v2 " Liao Yuanhong
2024-08-21 9:28 ` [PATCH 5/7] rtc:rtc-sa1100:Use " Liao Yuanhong
2024-08-21 11:27 ` Christophe JAILLET
2024-08-22 3:13 ` [PATCH v2 " Liao Yuanhong
2024-08-21 9:28 ` [PATCH 6/7] rtc:rtc-tegra:Use " Liao Yuanhong
2024-08-21 9:28 ` [PATCH 7/7] rtc:rtc-xgene:Use " Liao Yuanhong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a2724a97-e253-4ef3-a76f-d57294bf3060@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=alexandre.belloni@bootlin.com \
--cc=liaoyuanhong@vivo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®