From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: linux-rtc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Subject: [PATCH 2/8] rtc: ep93xx: convert to devm_rtc_allocate_device
Date: Fri, 19 Apr 2019 09:59:59 +0200 [thread overview]
Message-ID: <20190419080005.16138-2-alexandre.belloni@bootlin.com> (raw)
In-Reply-To: <20190419080005.16138-1-alexandre.belloni@bootlin.com>
This allows further improvement of the driver.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-ep93xx.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c
index db04ac445c69..f15391bc4597 100644
--- a/drivers/rtc/rtc-ep93xx.c
+++ b/drivers/rtc/rtc-ep93xx.c
@@ -138,11 +138,16 @@ static int ep93xx_rtc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ep93xx_rtc);
- ep93xx_rtc->rtc = devm_rtc_device_register(&pdev->dev,
- pdev->name, &ep93xx_rtc_ops, THIS_MODULE);
+ ep93xx_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(ep93xx_rtc->rtc))
return PTR_ERR(ep93xx_rtc->rtc);
+ ep93xx_rtc->rtc->ops = &ep93xx_rtc_ops;
+
+ err = rtc_register_device(ep93xx_rtc->rtc);
+ if (err)
+ return err;
+
err = sysfs_create_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files);
if (err)
return err;
--
2.20.1
next prev parent reply other threads:[~2019-04-19 20:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-19 7:59 [PATCH 1/8] rtc: ep93xx: stop setting platform_data Alexandre Belloni
2019-04-19 7:59 ` Alexandre Belloni [this message]
2019-04-19 8:00 ` [PATCH 3/8] rtc: ep93xx: use rtc_add_group Alexandre Belloni
2019-04-19 8:00 ` [PATCH 4/8] rtc: ep93xx: set range Alexandre Belloni
2019-04-19 8:00 ` [PATCH 5/8] rtc: ep93xx: switch to rtc_time64_to_tm Alexandre Belloni
2019-04-19 8:00 ` [PATCH 6/8] rtc: ep93xx: use .set_time Alexandre Belloni
2019-04-19 8:00 ` [PATCH 7/8] rtc: ep93xx: convert to SPDX identifier Alexandre Belloni
2019-04-19 8:00 ` [PATCH 8/8] rtc: ep93xx: fix checkpatch issues Alexandre Belloni
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=20190419080005.16138-2-alexandre.belloni@bootlin.com \
--to=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).