timer-of.c (b746a1a2860f4a918f32d10dc569115d282aaf2f) timer-of.c (043cf46825c102683b1027762c09c7e2b749e5a3)
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>

--- 43 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) {
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>

--- 43 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) {
60 pr_err("Failed to get interrupt %s for %s\n",
61 of_irq->name, np->full_name);
60 pr_err("Failed to get interrupt %s for %pOF\n",
61 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;

--- 117 unchanged lines hidden (view full) ---

187 if (to->flags & TIMER_OF_IRQ) {
188 ret = timer_of_irq_init(np, &to->of_irq);
189 if (ret)
190 goto out_fail;
191 flags |= TIMER_OF_IRQ;
192 }
193
194 if (!to->clkevt.name)
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;

--- 117 unchanged lines hidden (view full) ---

187 if (to->flags & TIMER_OF_IRQ) {
188 ret = timer_of_irq_init(np, &to->of_irq);
189 if (ret)
190 goto out_fail;
191 flags |= TIMER_OF_IRQ;
192 }
193
194 if (!to->clkevt.name)
195 to->clkevt.name = np->name;
195 to->clkevt.name = np->full_name;
196
197 to->np = np;
198
199 return ret;
200
201out_fail:
202 if (flags & TIMER_OF_IRQ)
203 timer_of_irq_exit(&to->of_irq);

--- 27 unchanged lines hidden ---
196
197 to->np = np;
198
199 return ret;
200
201out_fail:
202 if (flags & TIMER_OF_IRQ)
203 timer_of_irq_exit(&to->of_irq);

--- 27 unchanged lines hidden ---