aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorroel kluin <roel.kluin@gmail.com>2008-09-10 13:34:44 -0400
committerPaul Mundt <lethal@linux-sh.org>2008-09-11 01:59:24 -0400
commit2641dc92b3c7f979c7e4820cff2e765664358982 (patch)
tree652d4fc11316e5c1dbb0c0cc504cae37ade68055 /drivers/rtc
parentcc3c080d9f4484021e7b14f99de94a8c85a668d5 (diff)
rtc-sh: Unsigned rtc->{periodic,carry,alarm}_irq cannot be negative
possibly since commit b420b1a7a17ea88531d0e12b2f2679a0c8365803 Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-sh.c21
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 }