From: Gregory CLEMENT <gregory.clement@bootlin.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-rtc@vger.kernel.org
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/3] rtc: mv: convert to devm_rtc_allocate_device
Date: Fri, 15 Mar 2019 14:42:51 +0100 [thread overview]
Message-ID: <87d0mstfs4.fsf@FE-laptop> (raw)
In-Reply-To: <20190315133513.9909-2-alexandre.belloni@bootlin.com>
Hi Alexandre,
On ven., mars 15 2019, Alexandre Belloni <alexandre.belloni@bootlin.com> wrote:
> This allows further improvement of the driver.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com>
on Armada XP GP
Thanks,
Gregory
> ---
> drivers/rtc/rtc-mv.c | 21 +++++++++++----------
> 1 file changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
> index d13d06ea6709..ef704aef8663 100644
> --- a/drivers/rtc/rtc-mv.c
> +++ b/drivers/rtc/rtc-mv.c
> @@ -254,15 +254,7 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, pdata);
>
> - if (pdata->irq >= 0) {
> - device_init_wakeup(&pdev->dev, 1);
> - pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
> - &mv_rtc_alarm_ops,
> - THIS_MODULE);
> - } else {
> - pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
> - &mv_rtc_ops, THIS_MODULE);
> - }
> + pdata->rtc = devm_rtc_allocate_device(&pdev->dev);
> if (IS_ERR(pdata->rtc)) {
> ret = PTR_ERR(pdata->rtc);
> goto out;
> @@ -278,7 +270,16 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
> }
> }
>
> - return 0;
> + if (pdata->irq >= 0) {
> + device_init_wakeup(&pdev->dev, 1);
> + pdata->rtc->ops = &mv_rtc_alarm_ops;
> + } else {
> + pdata->rtc->ops = &mv_rtc_ops;
> + }
> +
> + ret = rtc_register_device(pdata->rtc);
> + if (!ret)
> + return 0;
> out:
> if (!IS_ERR(pdata->clk))
> clk_disable_unprepare(pdata->clk);
> --
> 2.20.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
next prev parent reply other threads:[~2019-03-15 13:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-15 13:35 [PATCH 1/3] rtc: mv: convert to SPDX identifier Alexandre Belloni
2019-03-15 13:35 ` [PATCH 2/3] rtc: mv: convert to devm_rtc_allocate_device Alexandre Belloni
2019-03-15 13:42 ` Gregory CLEMENT [this message]
2019-03-15 13:35 ` [PATCH 3/3] rtc: mv: add range Alexandre Belloni
2019-03-15 13:49 ` Gregory CLEMENT
2019-03-15 13:35 ` [PATCH 1/3] rtc: mv: convert to SPDX identifier Alexandre Belloni
2019-03-15 13:35 ` [PATCH 2/3] rtc: mv: convert to devm_rtc_allocate_device Alexandre Belloni
2019-03-15 13:41 ` [PATCH 1/3] rtc: mv: convert to SPDX identifier Gregory CLEMENT
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=87d0mstfs4.fsf@FE-laptop \
--to=gregory.clement@bootlin.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).