diff options
Diffstat (limited to 'drivers/clocksource/timer-of.c')
-rw-r--r-- | drivers/clocksource/timer-of.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index f6e7491c873c..4d7aef9d9c15 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c | |||
@@ -41,8 +41,16 @@ static __init int timer_irq_init(struct device_node *np, | |||
41 | struct timer_of *to = container_of(of_irq, struct timer_of, of_irq); | 41 | struct timer_of *to = container_of(of_irq, struct timer_of, of_irq); |
42 | struct clock_event_device *clkevt = &to->clkevt; | 42 | struct clock_event_device *clkevt = &to->clkevt; |
43 | 43 | ||
44 | of_irq->irq = of_irq->name ? of_irq_get_byname(np, of_irq->name): | 44 | if (of_irq->name) { |
45 | irq_of_parse_and_map(np, of_irq->index); | 45 | of_irq->irq = ret = of_irq_get_byname(np, of_irq->name); |
46 | if (ret < 0) { | ||
47 | pr_err("Failed to get interrupt %s for %s\n", | ||
48 | of_irq->name, np->full_name); | ||
49 | return ret; | ||
50 | } | ||
51 | } else { | ||
52 | of_irq->irq = irq_of_parse_and_map(np, of_irq->index); | ||
53 | } | ||
46 | if (!of_irq->irq) { | 54 | if (!of_irq->irq) { |
47 | pr_err("Failed to map interrupt for %s\n", np->full_name); | 55 | pr_err("Failed to map interrupt for %s\n", np->full_name); |
48 | return -EINVAL; | 56 | return -EINVAL; |
@@ -120,9 +128,9 @@ static __init int timer_base_init(struct device_node *np, | |||
120 | const char *name = of_base->name ? of_base->name : np->full_name; | 128 | const char *name = of_base->name ? of_base->name : np->full_name; |
121 | 129 | ||
122 | of_base->base = of_io_request_and_map(np, of_base->index, name); | 130 | of_base->base = of_io_request_and_map(np, of_base->index, name); |
123 | if (!of_base->base) { | 131 | if (IS_ERR(of_base->base)) { |
124 | pr_err("Failed to iomap (%s)\n", name); | 132 | pr_err("Failed to iomap (%s)\n", name); |
125 | return -ENXIO; | 133 | return PTR_ERR(of_base->base); |
126 | } | 134 | } |
127 | 135 | ||
128 | return 0; | 136 | return 0; |