Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[cascardo/linux.git] / drivers / rtc / rtc-sh.c
index 1f88e9e..3f393c8 100644 (file)
@@ -257,12 +257,6 @@ static inline void sh_rtc_setaie(struct device *dev, unsigned int enable)
        spin_unlock_irq(&rtc->lock);
 }
 
-static void sh_rtc_release(struct device *dev)
-{
-       sh_rtc_setpie(dev, 0);
-       sh_rtc_setaie(dev, 0);
-}
-
 static int sh_rtc_proc(struct device *dev, struct seq_file *seq)
 {
        struct sh_rtc *rtc = dev_get_drvdata(dev);
@@ -559,7 +553,6 @@ static int sh_rtc_irq_set_freq(struct device *dev, int freq)
 }
 
 static struct rtc_class_ops sh_rtc_ops = {
-       .release        = sh_rtc_release,
        .ioctl          = sh_rtc_ioctl,
        .read_time      = sh_rtc_read_time,
        .set_time       = sh_rtc_set_time,
@@ -575,7 +568,7 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev)
        struct sh_rtc *rtc;
        struct resource *res;
        unsigned int tmp;
-       int ret = -ENOENT;
+       int ret;
 
        rtc = kzalloc(sizeof(struct sh_rtc), GFP_KERNEL);
        if (unlikely(!rtc))
@@ -584,26 +577,33 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev)
        spin_lock_init(&rtc->lock);
 
        /* get periodic/carry/alarm irqs */
-       rtc->periodic_irq = platform_get_irq(pdev, 0);
-       if (unlikely(rtc->periodic_irq < 0)) {
+       ret = platform_get_irq(pdev, 0);
+       if (unlikely(ret < 0)) {
+               ret = -ENOENT;
                dev_err(&pdev->dev, "No IRQ for period\n");
                goto err_badres;
        }
+       rtc->periodic_irq = ret;
 
-       rtc->carry_irq = platform_get_irq(pdev, 1);
-       if (unlikely(rtc->carry_irq < 0)) {
+       ret = platform_get_irq(pdev, 1);
+       if (unlikely(ret < 0)) {
+               ret = -ENOENT;
                dev_err(&pdev->dev, "No IRQ for carry\n");
                goto err_badres;
        }
+       rtc->carry_irq = ret;
 
-       rtc->alarm_irq = platform_get_irq(pdev, 2);
-       if (unlikely(rtc->alarm_irq < 0)) {
+       ret = platform_get_irq(pdev, 2);
+       if (unlikely(ret < 0)) {
+               ret = -ENOENT;
                dev_err(&pdev->dev, "No IRQ for alarm\n");
                goto err_badres;
        }
+       rtc->alarm_irq = ret;
 
        res = platform_get_resource(pdev, IORESOURCE_IO, 0);
        if (unlikely(res == NULL)) {
+               ret = -ENOENT;
                dev_err(&pdev->dev, "No IO resource\n");
                goto err_badres;
        }