From: Jingoo Han <jg1.han@samsung.com>
To: "'Andrew Morton'" <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
"'Alessandro Zummo'" <a.zummo@towertech.it>,
rtc-linux@googlegroups.com, "'Jingoo Han'" <jg1.han@samsung.com>
Subject: [PATCH V2 20/30] rtc: rtc-s3c: use devm_rtc_device_register()
Date: Wed, 06 Mar 2013 16:54:15 +0900 [thread overview]
Message-ID: <008e01ce1a3f$cc967f80$65c37e80$%han@samsung.com> (raw)
In-Reply-To: <007b01ce1a3e$cd9f3260$68dd9720$%han@samsung.com>
devm_rtc_device_register() is device managed and makes cleanup
paths simpler.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
Changes since v1:
- used 'struct device *dev' as the first argument
drivers/rtc/rtc-s3c.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index fb994e9..7dcf719 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -423,10 +423,7 @@ static void s3c_rtc_enable(struct platform_device *pdev, int en)
static int s3c_rtc_remove(struct platform_device *dev)
{
- struct rtc_device *rtc = platform_get_drvdata(dev);
-
platform_set_drvdata(dev, NULL);
- rtc_device_unregister(rtc);
s3c_rtc_setaie(&dev->dev, 0);
@@ -511,7 +508,7 @@ static int s3c_rtc_probe(struct platform_device *pdev)
/* register RTC and exit */
- rtc = rtc_device_register("s3c", &pdev->dev, &s3c_rtcops,
+ rtc = devm_rtc_device_register(&pdev->dev, "s3c", &s3c_rtcops,
THIS_MODULE);
if (IS_ERR(rtc)) {
@@ -574,7 +571,6 @@ static int s3c_rtc_probe(struct platform_device *pdev)
err_alarm_irq:
platform_set_drvdata(pdev, NULL);
- rtc_device_unregister(rtc);
err_nortc:
s3c_rtc_enable(pdev, 0);
--
1.7.2.5
next prev parent reply other threads:[~2013-03-06 7:54 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 7:47 [PATCH V2 01/30] rtc: rtc-88pm80x: use devm_rtc_device_register() Jingoo Han
2013-03-06 7:47 ` [PATCH V2 02/30] rtc: rtc-coh90133: " Jingoo Han
2013-03-06 7:48 ` [PATCH V2 03/30] rtc: rtc-da9052: " Jingoo Han
2013-03-06 7:48 ` [PATCH V2 04/30] rtc: rtc-da9055: " Jingoo Han
2013-03-06 7:49 ` [PATCH V2 05/30] rtc: rtc-davinci: " Jingoo Han
2013-03-06 7:49 ` [PATCH V2 06/30] rtc: rtc-ds1511: " Jingoo Han
2013-03-06 7:49 ` [PATCH V2 07/30] rtc: rtc-ds1553: " Jingoo Han
2013-03-06 7:50 ` [PATCH V2 08/30] rtc: rtc-ds1742: " Jingoo Han
2013-03-06 7:50 ` [PATCH V2 09/30] rtc: rtc-ep93xx: " Jingoo Han
2013-03-06 7:50 ` [PATCH V2 10/30] rtc: rtc-imxdi: " Jingoo Han
2013-03-06 7:51 ` [PATCH V2 11/30] rtc: rtc-lp8788: " Jingoo Han
2013-03-06 7:51 ` [PATCH V2 12/30] rtc: rtc-lpc32xx: " Jingoo Han
2013-03-06 7:51 ` [PATCH V2 13/30] rtc: rtc-max77686: " Jingoo Han
2013-03-06 7:52 ` [PATCH V2 14/30] rtc: rtc-max8907: " Jingoo Han
2013-03-06 7:52 ` [PATCH V2 15/30] rtc: rtc-max8997: " Jingoo Han
2013-03-06 7:53 ` [PATCH V2 16/30] rtc: rtc-mv: " Jingoo Han
2013-03-06 7:53 ` [PATCH V2 17/30] rtc: rtc-mxc: " Jingoo Han
2013-03-06 7:53 ` [PATCH V2 18/30] rtc: rtc-palmas: " Jingoo Han
2013-03-06 7:53 ` [PATCH V2 19/30] rtc: rtc-pcf8523: " Jingoo Han
2013-03-06 7:54 ` Jingoo Han [this message]
2013-03-06 7:54 ` [PATCH V2 21/30] rtc: rtc-snvs: " Jingoo Han
2013-03-06 7:54 ` [PATCH V2 22/30] rtc: rtc-spear: " Jingoo Han
2013-03-06 13:39 ` Viresh Kumar
2013-03-06 7:55 ` [PATCH V2 23/30] rtc: rtc-stk17ta8: " Jingoo Han
2013-03-06 7:55 ` [PATCH V2 24/30] rtc: rtc-tegra: " Jingoo Han
2013-03-06 7:55 ` [PATCH V2 25/30] rtc: rtc-tps6586x: " Jingoo Han
2013-03-06 7:56 ` [PATCH V2 26/30] rtc: rtc-tps65910: " Jingoo Han
2013-03-06 7:56 ` [PATCH V2 27/30] rtc: rtc-tps80031: " Jingoo Han
2013-03-06 7:56 ` [PATCH V2 28/30] rtc: rtc-tx4939: " Jingoo Han
2013-03-06 7:57 ` [PATCH V2 29/30] rtc: rtc-vt8500: " Jingoo Han
2013-03-06 7:57 ` [PATCH V2 30/30] rtc: rtc-wm831x: " Jingoo Han
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='008e01ce1a3f$cc967f80$65c37e80$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=a.zummo@towertech.it \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.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