aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-da9052.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-02-21 19:45:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 20:22:30 -0500
commit27239a1498f85c16306fdc614658d0bc1ee685ef (patch)
tree54caabaab6b6d0adc7857a296d162a731bd38cbd /drivers/rtc/rtc-da9052.c
parentfd5231ce336e038037b4f0190a6838bdd6e17c6d (diff)
rtc: rtc-da9052: use devm_request_threaded_irq()
Use devm_request_threaded_irq() to make cleanup paths more simple. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-da9052.c')
-rw-r--r--drivers/rtc/rtc-da9052.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c
index 60b826e520e2..0dde688ca09b 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)
240 rtc->da9052 = dev_get_drvdata(pdev->dev.parent); 240 rtc->da9052 = dev_get_drvdata(pdev->dev.parent);
241 platform_set_drvdata(pdev, rtc); 241 platform_set_drvdata(pdev, rtc);
242 rtc->irq = platform_get_irq_byname(pdev, "ALM"); 242 rtc->irq = platform_get_irq_byname(pdev, "ALM");
243 ret = request_threaded_irq(rtc->irq, NULL, da9052_rtc_irq, 243 ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL,
244 IRQF_TRIGGER_LOW | IRQF_ONESHOT, 244 da9052_rtc_irq,
245 "ALM", rtc); 245 IRQF_TRIGGER_LOW | IRQF_ONESHOT,
246 "ALM", rtc);
246 if (ret != 0) { 247 if (ret != 0) {
247 rtc_err(rtc->da9052, "irq registration failed: %d\n", ret); 248 rtc_err(rtc->da9052, "irq registration failed: %d\n", ret);
248 return ret; 249 return ret;
@@ -250,16 +251,10 @@ static int da9052_rtc_probe(struct platform_device *pdev)
250 251
251 rtc->rtc = rtc_device_register(pdev->name, &pdev->dev, 252 rtc->rtc = rtc_device_register(pdev->name, &pdev->dev,
252 &da9052_rtc_ops, THIS_MODULE); 253 &da9052_rtc_ops, THIS_MODULE);
253 if (IS_ERR(rtc->rtc)) { 254 if (IS_ERR(rtc->rtc))
254 ret = PTR_ERR(rtc->rtc); 255 return PTR_ERR(rtc->rtc);
255 goto err_free_irq;
256 }
257 256
258 return 0; 257 return 0;
259
260err_free_irq:
261 free_irq(rtc->irq, rtc);
262 return ret;
263} 258}
264 259
265static int da9052_rtc_remove(struct platform_device *pdev) 260static int da9052_rtc_remove(struct platform_device *pdev)
@@ -267,7 +262,6 @@ static int da9052_rtc_remove(struct platform_device *pdev)
267 struct da9052_rtc *rtc = pdev->dev.platform_data; 262 struct da9052_rtc *rtc = pdev->dev.platform_data;
268 263
269 rtc_device_unregister(rtc->rtc); 264 rtc_device_unregister(rtc->rtc);
270 free_irq(rtc->irq, rtc);
271 platform_set_drvdata(pdev, NULL); 265 platform_set_drvdata(pdev, NULL);
272 266
273 return 0; 267 return 0;