[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <005601ce1a2c$313a9890$93afc9b0$%han@samsung.com>
Date: Wed, 06 Mar 2013 14:33:54 +0900
From: Jingoo Han <jg1.han@...sung.com>
To: 'Andrew Morton' <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org,
'Alessandro Zummo' <a.zummo@...ertech.it>,
rtc-linux@...glegroups.com, 'Jingoo Han' <jg1.han@...sung.com>
Subject: [PATCH 20/30] rtc: rtc-s3c: use devm_rtc_device_register()
devm_rtc_device_register() is device managed and makes cleanup
paths simpler.
Signed-off-by: Jingoo Han <jg1.han@...sung.com>
---
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..21ff72e 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("s3c", &pdev->dev, &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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists