| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2000, 2001 Broadcom Corporation |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or |
|---|
| 5 | | - * modify it under the terms of the GNU General Public License |
|---|
| 6 | | - * as published by the Free Software Foundation; either version 2 |
|---|
| 7 | | - * of the License, or (at your option) any later version. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | | - * GNU General Public License for more details. |
|---|
| 13 | | - * |
|---|
| 14 | | - * You should have received a copy of the GNU General Public License |
|---|
| 15 | | - * along with this program; if not, write to the Free Software |
|---|
| 16 | | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 17 | 4 | */ |
|---|
| 18 | 5 | #include <linux/clockchips.h> |
|---|
| 19 | 6 | #include <linux/interrupt.h> |
|---|
| .. | .. |
|---|
| 103 | 90 | } |
|---|
| 104 | 91 | |
|---|
| 105 | 92 | static DEFINE_PER_CPU(struct clock_event_device, sibyte_hpt_clockevent); |
|---|
| 106 | | -static DEFINE_PER_CPU(struct irqaction, sibyte_hpt_irqaction); |
|---|
| 107 | 93 | static DEFINE_PER_CPU(char [18], sibyte_hpt_name); |
|---|
| 108 | 94 | |
|---|
| 109 | 95 | void sb1250_clockevent_init(void) |
|---|
| 110 | 96 | { |
|---|
| 111 | 97 | unsigned int cpu = smp_processor_id(); |
|---|
| 112 | 98 | unsigned int irq = K_INT_TIMER_0 + cpu; |
|---|
| 113 | | - struct irqaction *action = &per_cpu(sibyte_hpt_irqaction, cpu); |
|---|
| 114 | 99 | struct clock_event_device *cd = &per_cpu(sibyte_hpt_clockevent, cpu); |
|---|
| 115 | 100 | unsigned char *name = per_cpu(sibyte_hpt_name, cpu); |
|---|
| 101 | + unsigned long flags = IRQF_PERCPU | IRQF_TIMER; |
|---|
| 116 | 102 | |
|---|
| 117 | 103 | /* Only have 4 general purpose timers, and we use last one as hpt */ |
|---|
| 118 | 104 | BUG_ON(cpu > 2); |
|---|
| .. | .. |
|---|
| 146 | 132 | |
|---|
| 147 | 133 | sb1250_unmask_irq(cpu, irq); |
|---|
| 148 | 134 | |
|---|
| 149 | | - action->handler = sibyte_counter_handler; |
|---|
| 150 | | - action->flags = IRQF_PERCPU | IRQF_TIMER; |
|---|
| 151 | | - action->name = name; |
|---|
| 152 | | - action->dev_id = cd; |
|---|
| 153 | | - |
|---|
| 154 | 135 | irq_set_affinity(irq, cpumask_of(cpu)); |
|---|
| 155 | | - setup_irq(irq, action); |
|---|
| 136 | + if (request_irq(irq, sibyte_counter_handler, flags, name, cd)) |
|---|
| 137 | + pr_err("Failed to request irq %d (%s)\n", irq, name); |
|---|
| 156 | 138 | } |
|---|