diff options
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-ds1302.c | 2 | ||||
-rw-r--r-- | drivers/rtc/rtc-sh.c | 21 |
2 files changed, 15 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-ds1302.c b/drivers/rtc/rtc-ds1302.c index 16bdba6a6b0c..184556620778 100644 --- a/drivers/rtc/rtc-ds1302.c +++ b/drivers/rtc/rtc-ds1302.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #define RTC_SCLK 0x0400 | 40 | #define RTC_SCLK 0x0400 |
41 | 41 | ||
42 | #ifdef CONFIG_SH_SECUREEDGE5410 | 42 | #ifdef CONFIG_SH_SECUREEDGE5410 |
43 | #include <asm/snapgear.h> | 43 | #include <mach/snapgear.h> |
44 | #define set_dp(x) SECUREEDGE_WRITE_IOPORT(x, 0x1c00) | 44 | #define set_dp(x) SECUREEDGE_WRITE_IOPORT(x, 0x1c00) |
45 | #define get_dp() SECUREEDGE_READ_IOPORT() | 45 | #define get_dp() SECUREEDGE_READ_IOPORT() |
46 | #else | 46 | #else |
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index 1ec297128ea6..aaf9d6a337cc 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 | } |