diff options
Diffstat (limited to 'drivers/rtc/rtc-sh.c')
-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 1f88e9e914ec..690a7800805a 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c | |||
@@ -575,7 +575,7 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev) | |||
575 | struct sh_rtc *rtc; | 575 | struct sh_rtc *rtc; |
576 | struct resource *res; | 576 | struct resource *res; |
577 | unsigned int tmp; | 577 | unsigned int tmp; |
578 | int ret = -ENOENT; | 578 | int ret; |
579 | 579 | ||
580 | rtc = kzalloc(sizeof(struct sh_rtc), GFP_KERNEL); | 580 | rtc = kzalloc(sizeof(struct sh_rtc), GFP_KERNEL); |
581 | if (unlikely(!rtc)) | 581 | if (unlikely(!rtc)) |
@@ -584,26 +584,33 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev) | |||
584 | spin_lock_init(&rtc->lock); | 584 | spin_lock_init(&rtc->lock); |
585 | 585 | ||
586 | /* get periodic/carry/alarm irqs */ | 586 | /* get periodic/carry/alarm irqs */ |
587 | rtc->periodic_irq = platform_get_irq(pdev, 0); | 587 | ret = platform_get_irq(pdev, 0); |
588 | if (unlikely(rtc->periodic_irq < 0)) { | 588 | if (unlikely(ret < 0)) { |
589 | ret = -ENOENT; | ||
589 | dev_err(&pdev->dev, "No IRQ for period\n"); | 590 | dev_err(&pdev->dev, "No IRQ for period\n"); |
590 | goto err_badres; | 591 | goto err_badres; |
591 | } | 592 | } |
593 | rtc->periodic_irq = ret; | ||
592 | 594 | ||
593 | rtc->carry_irq = platform_get_irq(pdev, 1); | 595 | ret = platform_get_irq(pdev, 1); |
594 | if (unlikely(rtc->carry_irq < 0)) { | 596 | if (unlikely(ret < 0)) { |
597 | ret = -ENOENT; | ||
595 | dev_err(&pdev->dev, "No IRQ for carry\n"); | 598 | dev_err(&pdev->dev, "No IRQ for carry\n"); |
596 | goto err_badres; | 599 | goto err_badres; |
597 | } | 600 | } |
601 | rtc->carry_irq = ret; | ||
598 | 602 | ||
599 | rtc->alarm_irq = platform_get_irq(pdev, 2); | 603 | ret = platform_get_irq(pdev, 2); |
600 | if (unlikely(rtc->alarm_irq < 0)) { | 604 | if (unlikely(ret < 0)) { |
605 | ret = -ENOENT; | ||
601 | dev_err(&pdev->dev, "No IRQ for alarm\n"); | 606 | dev_err(&pdev->dev, "No IRQ for alarm\n"); |
602 | goto err_badres; | 607 | goto err_badres; |
603 | } | 608 | } |
609 | rtc->alarm_irq = ret; | ||
604 | 610 | ||
605 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | 611 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); |
606 | if (unlikely(res == NULL)) { | 612 | if (unlikely(res == NULL)) { |
613 | ret = -ENOENT; | ||
607 | dev_err(&pdev->dev, "No IO resource\n"); | 614 | dev_err(&pdev->dev, "No IO resource\n"); |
608 | goto err_badres; | 615 | goto err_badres; |
609 | } | 616 | } |