From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: linux-rtc@vger.kernel.org
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Subject: [PATCH 2/6] rtc: at91sam9: convert to devm_rtc_allocate_device
Date: Wed, 20 Mar 2019 13:40:38 +0100 [thread overview]
Message-ID: <20190320124042.14141-2-alexandre.belloni@bootlin.com> (raw)
In-Reply-To: <20190320124042.14141-1-alexandre.belloni@bootlin.com>
This allows further improvement of the driver.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-at91sam9.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
index 7ec114b59513..cbbf8121dca0 100644
--- a/drivers/rtc/rtc-at91sam9.c
+++ b/drivers/rtc/rtc-at91sam9.c
@@ -418,13 +418,14 @@ static int at91_rtc_probe(struct platform_device *pdev)
mr &= ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN);
rtt_writel(rtc, MR, mr);
- rtc->rtcdev = devm_rtc_device_register(&pdev->dev, pdev->name,
- &at91_rtc_ops, THIS_MODULE);
+ rtc->rtcdev = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtc->rtcdev)) {
ret = PTR_ERR(rtc->rtcdev);
goto err_clk;
}
+ rtc->rtcdev->ops = &at91_rtc_ops;
+
/* register irq handler after we know what name we'll use */
ret = devm_request_irq(&pdev->dev, rtc->irq, at91_rtc_interrupt,
IRQF_SHARED | IRQF_COND_SUSPEND,
@@ -444,7 +445,7 @@ static int at91_rtc_probe(struct platform_device *pdev)
dev_warn(&pdev->dev, "%s: SET TIME!\n",
dev_name(&rtc->rtcdev->dev));
- return 0;
+ return rtc_register_device(rtc->rtcdev);
err_clk:
clk_disable_unprepare(rtc->sclk);
--
2.20.1
next prev parent reply other threads:[~2019-03-20 12:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-20 12:40 [PATCH 1/6] rtc: at91sam9: drop platform_data support Alexandre Belloni
2019-03-20 12:40 ` Alexandre Belloni [this message]
2019-03-20 12:40 ` [PATCH 3/6] rtc: at91sam9: set range Alexandre Belloni
2019-03-20 12:40 ` [PATCH 4/6] rtc: at91sam9: switch to rtc_time64_to_tm/rtc_tm_to_time64 Alexandre Belloni
2019-03-20 12:40 ` [PATCH 5/6] rtc: at91sam9: convert to SPDX identifier Alexandre Belloni
2019-03-20 12:40 ` [PATCH 6/6] rtc: at91sam9: correct trivial checkpatch warnings Alexandre Belloni
2019-03-21 10:11 ` [PATCH 1/6] rtc: at91sam9: drop platform_data support Nicolas.Ferre
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=20190320124042.14141-2-alexandre.belloni@bootlin.com \
--to=alexandre.belloni@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
/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).