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 1/7] rtc:rtc-at91rm9200:Use devm_clk_get_enabled() helpers
Date: Wed, 21 Aug 2024 13:22:56 +0200 [thread overview]
Message-ID: <29b1476e-28ca-4332-975d-c8ae630316bf@wanadoo.fr> (raw)
In-Reply-To: <20240821092846.20138-2-liaoyuanhong@vivo.com>
Le 21/08/2024 à 11:28, Liao Yuanhong a écrit :
> Use devm_clk_get_enabled() instead of clk functions in rtc-at91rm9200.
>
> Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
> ---
> drivers/rtc/rtc-at91rm9200.c | 18 +++---------------
> 1 file changed, 3 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c
> index c16fe711a0d9..81b2556930bb 100644
> --- a/drivers/rtc/rtc-at91rm9200.c
> +++ b/drivers/rtc/rtc-at91rm9200.c
> @@ -498,14 +498,9 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
> return PTR_ERR(rtc);
> platform_set_drvdata(pdev, rtc);
>
> - sclk = devm_clk_get(&pdev->dev, NULL);
> + sclk = devm_clk_get_enabled(&pdev->dev, NULL);
Hi,
so now the global sclk variable could easily be removed as well.
CJ
> if (IS_ERR(sclk))
> return PTR_ERR(sclk);
> -
> - ret = clk_prepare_enable(sclk);
> - if (ret) {
> - dev_err(&pdev->dev, "Could not enable slow clock\n");
> - return ret;
> }
>
> at91_rtc_write(AT91_RTC_CR, 0);
> @@ -521,7 +516,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
> "at91_rtc", pdev);
> if (ret) {
> dev_err(&pdev->dev, "IRQ %d already in use.\n", irq);
> - goto err_clk;
> + return ret;
> }
>
> /* cpu init code should really have flagged this device as
> @@ -539,7 +534,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
> rtc->range_max = RTC_TIMESTAMP_END_2099;
> ret = devm_rtc_register_device(rtc);
> if (ret)
> - goto err_clk;
> + return ret;
>
> /* enable SECEV interrupt in order to initialize at91_rtc_upd_rdy
> * completion.
> @@ -548,11 +543,6 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
>
> dev_info(&pdev->dev, "AT91 Real Time Clock driver.\n");
> return 0;
> -
> -err_clk:
> - clk_disable_unprepare(sclk);
> -
> - return ret;
> }
>
> /*
> @@ -564,8 +554,6 @@ static void __exit at91_rtc_remove(struct platform_device *pdev)
> at91_rtc_write_idr(AT91_RTC_ACKUPD | AT91_RTC_ALARM |
> AT91_RTC_SECEV | AT91_RTC_TIMEV |
> AT91_RTC_CALEV);
> -
> - clk_disable_unprepare(sclk);
> }
>
> static void at91_rtc_shutdown(struct platform_device *pdev)
next prev parent reply other threads:[~2024-08-21 11:23 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 [this message]
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
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=29b1476e-28ca-4332-975d-c8ae630316bf@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®