timer-of.c (822bbba0cabb50825a0ce22707dc45eb82d02853) | timer-of.c (ccb80012481fd8d16c7557c00bb54c42103eef9d) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (c) 2017, Linaro Ltd. All rights reserved. 4 * 5 * Author: Daniel Lezcano <daniel.lezcano@linaro.org> 6 */ 7#include <linux/clk.h> 8#include <linux/interrupt.h> --- 11 unchanged lines hidden (view full) --- 20 * Free the irq resource 21 */ 22static __init void timer_of_irq_exit(struct of_timer_irq *of_irq) 23{ 24 struct timer_of *to = container_of(of_irq, struct timer_of, of_irq); 25 26 struct clock_event_device *clkevt = &to->clkevt; 27 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (c) 2017, Linaro Ltd. All rights reserved. 4 * 5 * Author: Daniel Lezcano <daniel.lezcano@linaro.org> 6 */ 7#include <linux/clk.h> 8#include <linux/interrupt.h> --- 11 unchanged lines hidden (view full) --- 20 * Free the irq resource 21 */ 22static __init void timer_of_irq_exit(struct of_timer_irq *of_irq) 23{ 24 struct timer_of *to = container_of(of_irq, struct timer_of, of_irq); 25 26 struct clock_event_device *clkevt = &to->clkevt; 27 |
28 if (of_irq->percpu) 29 free_percpu_irq(of_irq->irq, clkevt); 30 else | 28 of_irq->percpu ? free_percpu_irq(of_irq->irq, clkevt) : |
31 free_irq(of_irq->irq, clkevt); 32} 33 34/** 35 * timer_of_irq_init - Request the interrupt 36 * @np: a device tree node pointer 37 * @of_irq: an of_timer_irq structure pointer 38 * --- 13 unchanged lines hidden (view full) --- 52{ 53 int ret; 54 struct timer_of *to = container_of(of_irq, struct timer_of, of_irq); 55 struct clock_event_device *clkevt = &to->clkevt; 56 57 if (of_irq->name) { 58 of_irq->irq = ret = of_irq_get_byname(np, of_irq->name); 59 if (ret < 0) { | 29 free_irq(of_irq->irq, clkevt); 30} 31 32/** 33 * timer_of_irq_init - Request the interrupt 34 * @np: a device tree node pointer 35 * @of_irq: an of_timer_irq structure pointer 36 * --- 13 unchanged lines hidden (view full) --- 50{ 51 int ret; 52 struct timer_of *to = container_of(of_irq, struct timer_of, of_irq); 53 struct clock_event_device *clkevt = &to->clkevt; 54 55 if (of_irq->name) { 56 of_irq->irq = ret = of_irq_get_byname(np, of_irq->name); 57 if (ret < 0) { |
60 pr_err("Failed to get interrupt %s for %s\n", 61 of_irq->name, np->full_name); | 58 pr_err("Failed to get interrupt %s for %pOF\n", 59 of_irq->name, np); |
62 return ret; 63 } 64 } else { 65 of_irq->irq = irq_of_parse_and_map(np, of_irq->index); 66 } 67 if (!of_irq->irq) { 68 pr_err("Failed to map interrupt for %pOF\n", np); 69 return -EINVAL; --- 161 unchanged lines hidden --- | 60 return ret; 61 } 62 } else { 63 of_irq->irq = irq_of_parse_and_map(np, of_irq->index); 64 } 65 if (!of_irq->irq) { 66 pr_err("Failed to map interrupt for %pOF\n", np); 67 return -EINVAL; --- 161 unchanged lines hidden --- |