linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Support Opensource <Support.Opensource@diasemi.com>,
	Alessandro Zummo <a.zummo@towertech.it>
Cc: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>,
	"linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v2] rtc: da9052: convert to devm_rtc_allocate_device
Date: Wed, 1 Apr 2020 10:28:01 +0000	[thread overview]
Message-ID: <AM6PR10MB226324E39171E3A970538C2480C90@AM6PR10MB2263.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20200329224240.776568-1-alexandre.belloni@bootlin.com>

On 29 March 2020 23:43, Alexandre Belloni wrote:

> This allows further improvement of the driver.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>

> ---
> 
> Changes in v2:
>  - avoid reordering rtc registration and irq request.
> 
>  drivers/rtc/rtc-da9052.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c
> index 204eb7cf1aa4..e76561b8ad4c 100644
> --- a/drivers/rtc/rtc-da9052.c
> +++ b/drivers/rtc/rtc-da9052.c
> @@ -298,12 +298,16 @@ static int da9052_rtc_probe(struct platform_device
> *pdev)
>  		rtc_err(rtc, "Failed to disable TICKS: %d\n", ret);
> 
>  	device_init_wakeup(&pdev->dev, true);
> -	rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
> -				       &da9052_rtc_ops, THIS_MODULE);
> -
> +	rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
>  	if (IS_ERR(rtc->rtc))
>  		return PTR_ERR(rtc->rtc);
> 
> +	rtc->rtc->ops = &da9052_rtc_ops;
> +
> +	ret = rtc_register_device(rtc->rtc);
> +	if (ret)
> +		return ret;
> +
>  	ret = da9052_request_irq(rtc->da9052, DA9052_IRQ_ALARM, "ALM",
>  				da9052_rtc_irq, rtc);
>  	if (ret != 0) {
> --
> 2.25.1


      reply	other threads:[~2020-04-01 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-29 22:42 [PATCH v2] rtc: da9052: convert to devm_rtc_allocate_device Alexandre Belloni
2020-04-01 10:28 ` Adam Thomson [this message]

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=AM6PR10MB226324E39171E3A970538C2480C90@AM6PR10MB2263.EURPRD10.PROD.OUTLOOK.COM \
    --to=adam.thomson.opensource@diasemi.com \
    --cc=Support.Opensource@diasemi.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.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;
as well as URLs for NNTP newsgroup(s).