public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 13/30] rtc: rtc-max77686: use devm_rtc_device_register()
Date: Wed, 06 Mar 2013 14:31:34 +0900	[thread overview]
Message-ID: <004f01ce1a2b$ddf219b0$99d64d10$%han@samsung.com> (raw)
In-Reply-To: <004301ce1a2b$3ad77e00$b0867a00$%han@samsung.com>

devm_rtc_device_register() is device managed and makes cleanup
paths simpler. Also, this patch uses devm_request_threaded_irq().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/rtc/rtc-max77686.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c
index df66bab..69524c8 100644
--- a/drivers/rtc/rtc-max77686.c
+++ b/drivers/rtc/rtc-max77686.c
@@ -538,8 +538,8 @@ static int max77686_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	info->rtc_dev = rtc_device_register("max77686-rtc", &pdev->dev,
-			&max77686_rtc_ops, THIS_MODULE);
+	info->rtc_dev = devm_rtc_device_register("max77686-rtc", &pdev->dev,
+					&max77686_rtc_ops, THIS_MODULE);
 
 	if (IS_ERR(info->rtc_dev)) {
 		dev_info(&pdev->dev, "%s: fail\n", __func__);
@@ -555,8 +555,8 @@ static int max77686_rtc_probe(struct platform_device *pdev)
 		goto err_rtc;
 	info->virq = virq;
 
-	ret = request_threaded_irq(virq, NULL, max77686_rtc_alarm_irq, 0,
-			"rtc-alarm0", info);
+	ret = devm_request_threaded_irq(&pdev->dev, virq, NULL,
+				max77686_rtc_alarm_irq, 0, "rtc-alarm0", info);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
 			info->virq, ret);
@@ -569,13 +569,6 @@ err_rtc:
 
 static int max77686_rtc_remove(struct platform_device *pdev)
 {
-	struct max77686_rtc_info *info = platform_get_drvdata(pdev);
-
-	if (info) {
-		free_irq(info->virq, info);
-		rtc_device_unregister(info->rtc_dev);
-	}
-
 	return 0;
 }
 
-- 
1.7.2.5



  parent reply	other threads:[~2013-03-06  5:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-06  5:27 [PATCH 01/30] rtc: rtc-88pm80x: use devm_rtc_device_register() Jingoo Han
2013-03-06  5:27 ` [PATCH 02/30] rtc: rtc-coh90133: " Jingoo Han
2013-03-06  5:28 ` [PATCH 03/30] rtc: rtc-da9052: " Jingoo Han
2013-03-06  5:28 ` [PATCH 04/30] rtc: rtc-da9055: " Jingoo Han
2013-03-06  5:28 ` [PATCH 05/30] rtc: rtc-davinci: " Jingoo Han
2013-03-06  5:29 ` [PATCH 06/30] rtc: rtc-ds1511: " Jingoo Han
2013-03-06  5:29 ` [PATCH 07/30] rtc: rtc-ds1553: " Jingoo Han
2013-03-06  5:29 ` [PATCH 08/30] rtc: rtc-ds1742: " Jingoo Han
2013-03-06  5:30 ` [PATCH 09/30] rtc: rtc-ep93xx: " Jingoo Han
2013-03-06  5:30 ` [PATCH 10/30] rtc: rtc-imxdi: " Jingoo Han
2013-03-06  5:30 ` [PATCH 11/30] rtc: rtc-lp8788: " Jingoo Han
2013-03-06  5:31 ` [PATCH 12/30] rtc: rtc-lpc32xx: " Jingoo Han
2013-03-06  5:31 ` Jingoo Han [this message]
2013-03-06  5:31 ` [PATCH 14/30] rtc: rtc-max8907: " Jingoo Han
2013-03-06  5:32 ` [PATCH 15/30] rtc: rtc-max8997: " Jingoo Han
2013-03-06  5:32 ` [PATCH 16/30] rtc: rtc-mv: " Jingoo Han
2013-03-06  5:32 ` [PATCH 17/30] rtc: rtc-mxc: " Jingoo Han
2013-03-06  5:33 ` [PATCH 18/30] rtc: rtc-palmas: " Jingoo Han
2013-03-06  5:33 ` [PATCH 19/30] rtc: rtc-pcf8523: " Jingoo Han
2013-03-06  5:33 ` [PATCH 20/30] rtc: rtc-s3c: " Jingoo Han
2013-03-06  5:34 ` [PATCH 21/30] rtc: rtc-snvs: " Jingoo Han
2013-03-06  5:34 ` [PATCH 22/30] rtc: rtc-spear: " Jingoo Han
2013-03-06  5:34 ` [PATCH 23/30] rtc: rtc-stk17ta8: " Jingoo Han
2013-03-06  5:35 ` [PATCH 24/30] rtc: rtc-tegra: " Jingoo Han
2013-03-06  5:35 ` [PATCH 25/30] rtc: rtc-tps6586x: " Jingoo Han
2013-03-06  5:35 ` [PATCH 26/30] rtc: rtc-tps65910: " Jingoo Han
2013-03-06  5:36 ` [PATCH 27/30] rtc: rtc-tps80031: " Jingoo Han
2013-03-06  5:36 ` [PATCH 28/30] rtc: rtc-tx4939: " Jingoo Han
2013-03-06  5:36 ` [PATCH 29/30] rtc: rtc-vt8500: " Jingoo Han
2013-03-06  5:37 ` [PATCH 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='004f01ce1a2b$ddf219b0$99d64d10$%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