diff options
author | Johan Hovold <johan@kernel.org> | 2014-12-10 18:52:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 20:41:13 -0500 |
commit | 437b37a66a224471b669e9d3c791e908e47e804d (patch) | |
tree | f5b5334494c61d7d8adccd6e8c47982e36a492e5 /drivers/rtc | |
parent | 1ed8b5d26c33d5c95845be7d51aae2bf6f1b053c (diff) |
rtc: omap: clean up probe error handling
Remove some debug messages and return errors from subsystems rather than
always fail with -EIO.
Note that the class-registration error has already been logged by rtc
core.
Signed-off-by: Johan Hovold <johan@kernel.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Benot Cousson <bcousson@baylibre.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Keerthy J <j-keerthy@ti.com>
Tested-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-omap.c | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index 813d475fe7c6..6b10db5a5702 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c | |||
@@ -379,6 +379,7 @@ static int __init omap_rtc_probe(struct platform_device *pdev) | |||
379 | u8 reg, new_ctrl; | 379 | u8 reg, new_ctrl; |
380 | const struct platform_device_id *id_entry; | 380 | const struct platform_device_id *id_entry; |
381 | const struct of_device_id *of_id; | 381 | const struct of_device_id *of_id; |
382 | int ret; | ||
382 | 383 | ||
383 | of_id = of_match_device(omap_rtc_of_match, &pdev->dev); | 384 | of_id = of_match_device(omap_rtc_of_match, &pdev->dev); |
384 | if (of_id) | 385 | if (of_id) |
@@ -391,16 +392,12 @@ static int __init omap_rtc_probe(struct platform_device *pdev) | |||
391 | } | 392 | } |
392 | 393 | ||
393 | omap_rtc_timer = platform_get_irq(pdev, 0); | 394 | omap_rtc_timer = platform_get_irq(pdev, 0); |
394 | if (omap_rtc_timer <= 0) { | 395 | if (omap_rtc_timer <= 0) |
395 | pr_debug("%s: no update irq?\n", pdev->name); | ||
396 | return -ENOENT; | 396 | return -ENOENT; |
397 | } | ||
398 | 397 | ||
399 | omap_rtc_alarm = platform_get_irq(pdev, 1); | 398 | omap_rtc_alarm = platform_get_irq(pdev, 1); |
400 | if (omap_rtc_alarm <= 0) { | 399 | if (omap_rtc_alarm <= 0) |
401 | pr_debug("%s: no alarm irq?\n", pdev->name); | ||
402 | return -ENOENT; | 400 | return -ENOENT; |
403 | } | ||
404 | 401 | ||
405 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 402 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
406 | rtc_base = devm_ioremap_resource(&pdev->dev, res); | 403 | rtc_base = devm_ioremap_resource(&pdev->dev, res); |
@@ -421,9 +418,8 @@ static int __init omap_rtc_probe(struct platform_device *pdev) | |||
421 | rtc = devm_rtc_device_register(&pdev->dev, pdev->name, | 418 | rtc = devm_rtc_device_register(&pdev->dev, pdev->name, |
422 | &omap_rtc_ops, THIS_MODULE); | 419 | &omap_rtc_ops, THIS_MODULE); |
423 | if (IS_ERR(rtc)) { | 420 | if (IS_ERR(rtc)) { |
424 | pr_debug("%s: can't register RTC device, err %ld\n", | 421 | ret = PTR_ERR(rtc); |
425 | pdev->name, PTR_ERR(rtc)); | 422 | goto err; |
426 | goto fail0; | ||
427 | } | 423 | } |
428 | platform_set_drvdata(pdev, rtc); | 424 | platform_set_drvdata(pdev, rtc); |
429 | 425 | ||
@@ -451,18 +447,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev) | |||
451 | rtc_write(OMAP_RTC_STATUS_ALARM, OMAP_RTC_STATUS_REG); | 447 | rtc_write(OMAP_RTC_STATUS_ALARM, OMAP_RTC_STATUS_REG); |
452 | 448 | ||
453 | /* handle periodic and alarm irqs */ | 449 | /* handle periodic and alarm irqs */ |
454 | if (devm_request_irq(&pdev->dev, omap_rtc_timer, rtc_irq, 0, | 450 | ret = devm_request_irq(&pdev->dev, omap_rtc_timer, rtc_irq, 0, |
455 | dev_name(&rtc->dev), rtc)) { | 451 | dev_name(&rtc->dev), rtc); |
456 | pr_debug("%s: RTC timer interrupt IRQ%d already claimed\n", | 452 | if (ret) |
457 | pdev->name, omap_rtc_timer); | 453 | goto err; |
458 | goto fail0; | 454 | |
459 | } | 455 | if (omap_rtc_timer != omap_rtc_alarm) { |
460 | if ((omap_rtc_timer != omap_rtc_alarm) && | 456 | ret = devm_request_irq(&pdev->dev, omap_rtc_alarm, rtc_irq, 0, |
461 | (devm_request_irq(&pdev->dev, omap_rtc_alarm, rtc_irq, 0, | 457 | dev_name(&rtc->dev), rtc); |
462 | dev_name(&rtc->dev), rtc))) { | 458 | if (ret) |
463 | pr_debug("%s: RTC alarm interrupt IRQ%d already claimed\n", | 459 | goto err; |
464 | pdev->name, omap_rtc_alarm); | ||
465 | goto fail0; | ||
466 | } | 460 | } |
467 | 461 | ||
468 | /* On boards with split power, RTC_ON_NOFF won't reset the RTC */ | 462 | /* On boards with split power, RTC_ON_NOFF won't reset the RTC */ |
@@ -496,13 +490,14 @@ static int __init omap_rtc_probe(struct platform_device *pdev) | |||
496 | 490 | ||
497 | return 0; | 491 | return 0; |
498 | 492 | ||
499 | fail0: | 493 | err: |
500 | device_init_wakeup(&pdev->dev, false); | 494 | device_init_wakeup(&pdev->dev, false); |
501 | if (id_entry->driver_data & OMAP_RTC_HAS_KICKER) | 495 | if (id_entry->driver_data & OMAP_RTC_HAS_KICKER) |
502 | rtc_writel(0, OMAP_RTC_KICK0_REG); | 496 | rtc_writel(0, OMAP_RTC_KICK0_REG); |
503 | pm_runtime_put_sync(&pdev->dev); | 497 | pm_runtime_put_sync(&pdev->dev); |
504 | pm_runtime_disable(&pdev->dev); | 498 | pm_runtime_disable(&pdev->dev); |
505 | return -EIO; | 499 | |
500 | return ret; | ||
506 | } | 501 | } |
507 | 502 | ||
508 | static int __exit omap_rtc_remove(struct platform_device *pdev) | 503 | static int __exit omap_rtc_remove(struct platform_device *pdev) |