diff options
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-sh.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index fcead4c4cd1f..3f393c82e32c 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c | |||
@@ -568,7 +568,7 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev) | |||
568 | struct sh_rtc *rtc; | 568 | struct sh_rtc *rtc; |
569 | struct resource *res; | 569 | struct resource *res; |
570 | unsigned int tmp; | 570 | unsigned int tmp; |
571 | int ret = -ENOENT; | 571 | int ret; |
572 | 572 | ||
573 | rtc = kzalloc(sizeof(struct sh_rtc), GFP_KERNEL); | 573 | rtc = kzalloc(sizeof(struct sh_rtc), GFP_KERNEL); |
574 | if (unlikely(!rtc)) | 574 | if (unlikely(!rtc)) |
@@ -577,26 +577,33 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev) | |||
577 | spin_lock_init(&rtc->lock); | 577 | spin_lock_init(&rtc->lock); |
578 | 578 | ||
579 | /* get periodic/carry/alarm irqs */ | 579 | /* get periodic/carry/alarm irqs */ |
580 | rtc->periodic_irq = platform_get_irq(pdev, 0); | 580 | ret = platform_get_irq(pdev, 0); |
581 | if (unlikely(rtc->periodic_irq < 0)) { | 581 | if (unlikely(ret < 0)) { |
582 | ret = -ENOENT; | ||
582 | dev_err(&pdev->dev, "No IRQ for period\n"); | 583 | dev_err(&pdev->dev, "No IRQ for period\n"); |
583 | goto err_badres; | 584 | goto err_badres; |
584 | } | 585 | } |
586 | rtc->periodic_irq = ret; | ||
585 | 587 | ||
586 | rtc->carry_irq = platform_get_irq(pdev, 1); | 588 | ret = platform_get_irq(pdev, 1); |
587 | if (unlikely(rtc->carry_irq < 0)) { | 589 | if (unlikely(ret < 0)) { |
590 | ret = -ENOENT; | ||
588 | dev_err(&pdev->dev, "No IRQ for carry\n"); | 591 | dev_err(&pdev->dev, "No IRQ for carry\n"); |
589 | goto err_badres; | 592 | goto err_badres; |
590 | } | 593 | } |
594 | rtc->carry_irq = ret; | ||
591 | 595 | ||
592 | rtc->alarm_irq = platform_get_irq(pdev, 2); | 596 | ret = platform_get_irq(pdev, 2); |
593 | if (unlikely(rtc->alarm_irq < 0)) { | 597 | if (unlikely(ret < 0)) { |
598 | ret = -ENOENT; | ||
594 | dev_err(&pdev->dev, "No IRQ for alarm\n"); | 599 | dev_err(&pdev->dev, "No IRQ for alarm\n"); |
595 | goto err_badres; | 600 | goto err_badres; |
596 | } | 601 | } |
602 | rtc->alarm_irq = ret; | ||
597 | 603 | ||
598 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | 604 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); |
599 | if (unlikely(res == NULL)) { | 605 | if (unlikely(res == NULL)) { |
606 | ret = -ENOENT; | ||
600 | dev_err(&pdev->dev, "No IO resource\n"); | 607 | dev_err(&pdev->dev, "No IO resource\n"); |
601 | goto err_badres; | 608 | goto err_badres; |
602 | } | 609 | } |