Merge branch 'topic/msm8916' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[sfrench/cifs-2.6.git] / drivers / clocksource / timer-of.c
index f6e7491c873cd8767b92c0ba0e1222052e1bdc4c..4d7aef9d9c15422df0e9973e72379b2e21256f47 100644 (file)
@@ -41,8 +41,16 @@ static __init int timer_irq_init(struct device_node *np,
        struct timer_of *to = container_of(of_irq, struct timer_of, of_irq);
        struct clock_event_device *clkevt = &to->clkevt;
 
-       of_irq->irq = of_irq->name ? of_irq_get_byname(np, of_irq->name):
-               irq_of_parse_and_map(np, of_irq->index);
+       if (of_irq->name) {
+               of_irq->irq = ret = of_irq_get_byname(np, of_irq->name);
+               if (ret < 0) {
+                       pr_err("Failed to get interrupt %s for %s\n",
+                              of_irq->name, np->full_name);
+                       return ret;
+               }
+       } else  {
+               of_irq->irq = irq_of_parse_and_map(np, of_irq->index);
+       }
        if (!of_irq->irq) {
                pr_err("Failed to map interrupt for %s\n", np->full_name);
                return -EINVAL;
@@ -120,9 +128,9 @@ static __init int timer_base_init(struct device_node *np,
        const char *name = of_base->name ? of_base->name : np->full_name;
 
        of_base->base = of_io_request_and_map(np, of_base->index, name);
-       if (!of_base->base) {
+       if (IS_ERR(of_base->base)) {
                pr_err("Failed to iomap (%s)\n", name);
-               return -ENXIO;
+               return PTR_ERR(of_base->base);
        }
 
        return 0;