forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/arch/mips/alchemy/common/time.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2008-2009 Manuel Lauss <manuel.lauss@gmail.com>
34 *
....@@ -9,19 +10,6 @@
910 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
1011 *
1112 * ########################################################################
12
- *
13
- * This program is free software; you can distribute it and/or modify it
14
- * under the terms of the GNU General Public License (Version 2) as
15
- * published by the Free Software Foundation.
16
- *
17
- * This program is distributed in the hope it will be useful, but WITHOUT
18
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20
- * for more details.
21
- *
22
- * You should have received a copy of the GNU General Public License along
23
- * with this program; if not, write to the Free Software Foundation, Inc.,
24
- * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
2513 *
2614 * ########################################################################
2715 *
....@@ -81,14 +69,7 @@
8169 .features = CLOCK_EVT_FEAT_ONESHOT,
8270 .rating = 1500,
8371 .set_next_event = au1x_rtcmatch2_set_next_event,
84
- .cpumask = cpu_all_mask,
85
-};
86
-
87
-static struct irqaction au1x_rtcmatch2_irqaction = {
88
- .handler = au1x_rtcmatch2_irq,
89
- .flags = IRQF_TIMER,
90
- .name = "timer",
91
- .dev_id = &au1x_rtcmatch2_clockdev,
72
+ .cpumask = cpu_possible_mask,
9273 };
9374
9475 static int __init alchemy_time_init(unsigned int m2int)
....@@ -142,7 +123,9 @@
142123 cd->min_delta_ns = clockevent_delta2ns(9, cd);
143124 cd->min_delta_ticks = 9; /* ~0.28ms */
144125 clockevents_register_device(cd);
145
- setup_irq(m2int, &au1x_rtcmatch2_irqaction);
126
+ if (request_irq(m2int, au1x_rtcmatch2_irq, IRQF_TIMER, "timer",
127
+ &au1x_rtcmatch2_clockdev))
128
+ pr_err("Failed to register timer interrupt\n");
146129
147130 printk(KERN_INFO "Alchemy clocksource installed\n");
148131