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 08/12] rtc: rtc-da9052: use devm_request_threaded_irq()
Date: Thu, 21 Feb 2013 17:36:09 +0900 [thread overview]
Message-ID: <00d301ce100e$7fced110$7f6c7330$%han@samsung.com> (raw)
In-Reply-To: <00cc01ce100d$f42fddc0$dc8f9940$%han@samsung.com>
Use devm_request_threaded_irq() to make cleanup paths more simple.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/rtc/rtc-da9052.c | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c
index 60b826e..0dde688 100644
--- a/drivers/rtc/rtc-da9052.c
+++ b/drivers/rtc/rtc-da9052.c
@@ -240,9 +240,10 @@ static int da9052_rtc_probe(struct platform_device *pdev)
rtc->da9052 = dev_get_drvdata(pdev->dev.parent);
platform_set_drvdata(pdev, rtc);
rtc->irq = platform_get_irq_byname(pdev, "ALM");
- ret = request_threaded_irq(rtc->irq, NULL, da9052_rtc_irq,
- IRQF_TRIGGER_LOW | IRQF_ONESHOT,
- "ALM", rtc);
+ ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL,
+ da9052_rtc_irq,
+ IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+ "ALM", rtc);
if (ret != 0) {
rtc_err(rtc->da9052, "irq registration failed: %d\n", ret);
return ret;
@@ -250,16 +251,10 @@ static int da9052_rtc_probe(struct platform_device *pdev)
rtc->rtc = rtc_device_register(pdev->name, &pdev->dev,
&da9052_rtc_ops, THIS_MODULE);
- if (IS_ERR(rtc->rtc)) {
- ret = PTR_ERR(rtc->rtc);
- goto err_free_irq;
- }
+ if (IS_ERR(rtc->rtc))
+ return PTR_ERR(rtc->rtc);
return 0;
-
-err_free_irq:
- free_irq(rtc->irq, rtc);
- return ret;
}
static int da9052_rtc_remove(struct platform_device *pdev)
@@ -267,7 +262,6 @@ static int da9052_rtc_remove(struct platform_device *pdev)
struct da9052_rtc *rtc = pdev->dev.platform_data;
rtc_device_unregister(rtc->rtc);
- free_irq(rtc->irq, rtc);
platform_set_drvdata(pdev, NULL);
return 0;
--
1.7.2.5
next prev parent reply other threads:[~2013-02-21 8:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-21 8:32 [PATCH 01/12] rtc: rtc-imxdi: use devm_clk_get() Jingoo Han
2013-02-21 8:33 ` [PATCH 02/12] rtc: rtc-tps6586x: use devm_request_threaded_irq() Jingoo Han
2013-02-21 8:33 ` [PATCH 03/12] rtc: rtc-vt8500: use devm_*() functions Jingoo Han
2013-02-21 8:34 ` [PATCH 04/12] rtc: rtc-coh901331: use devm_clk_get() Jingoo Han
2013-02-21 8:34 ` [PATCH 05/12] rtc: rtc-lp8788: use devm_request_threaded_irq() Jingoo Han
2013-02-21 8:35 ` [PATCH 06/12] rtc: rtc-tps80031: " Jingoo Han
2013-02-21 8:35 ` [PATCH 07/12] rtc: rtc-wm831x: " Jingoo Han
2013-02-21 8:36 ` Jingoo Han [this message]
2013-02-21 8:36 ` [PATCH 09/12] rtc: rtc-palmas: " Jingoo Han
2013-02-21 8:37 ` [PATCH 10/12] rtc: rtc-max8907: " Jingoo Han
2013-02-21 8:37 ` [PATCH 11/12] rtc: rtc-max8997: " Jingoo Han
2013-02-21 8:38 ` [PATCH 12/12] rtc: rtc-davinci: use devm_*() functions 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='00d301ce100e$7fced110$7f6c7330$%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
all inboxes | Powered by JetHome®