summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-21 11:18:09 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-21 11:18:09 -0700
commite234b4a807202990a0aec4e74aa552fe76b5b6d2 (patch)
tree72e23ab12916c8104af8dcf701718a95d86e1af6
parent5a77f0254b35e0bea414305e1b71a6bdaee814dc (diff)
parent32f2fea6e77e64cd4045ec2d5deb879aada3b476 (diff)
downloadlinux-stable-e234b4a807202990a0aec4e74aa552fe76b5b6d2.tar.gz
linux-stable-e234b4a807202990a0aec4e74aa552fe76b5b6d2.tar.bz2
linux-stable-e234b4a807202990a0aec4e74aa552fe76b5b6d2.zip
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fix from Ingo Molnar: "A timer_irq_init() clocksource API robustness fix" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource/drivers/timer-of: Handle of_irq_get_byname() result correctly
-rw-r--r--drivers/clocksource/timer-of.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c
index f6e7491c873c..d509b500a7b5 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,
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;