hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/mips/ralink/cevt-rt3352.c
....@@ -82,12 +82,6 @@
8282 },
8383 };
8484
85
-static struct irqaction systick_irqaction = {
86
- .handler = systick_interrupt,
87
- .flags = IRQF_PERCPU | IRQF_TIMER,
88
- .dev_id = &systick.dev,
89
-};
90
-
9185 static int systick_shutdown(struct clock_event_device *evt)
9286 {
9387 struct systick_device *sdev;
....@@ -95,7 +89,7 @@
9589 sdev = container_of(evt, struct systick_device, dev);
9690
9791 if (sdev->irq_requested)
98
- free_irq(systick.dev.irq, &systick_irqaction);
92
+ free_irq(systick.dev.irq, &systick.dev);
9993 sdev->irq_requested = 0;
10094 iowrite32(0, systick.membase + SYSTICK_CONFIG);
10195
....@@ -104,12 +98,17 @@
10498
10599 static int systick_set_oneshot(struct clock_event_device *evt)
106100 {
101
+ const char *name = systick.dev.name;
107102 struct systick_device *sdev;
103
+ int irq = systick.dev.irq;
108104
109105 sdev = container_of(evt, struct systick_device, dev);
110106
111
- if (!sdev->irq_requested)
112
- setup_irq(systick.dev.irq, &systick_irqaction);
107
+ if (!sdev->irq_requested) {
108
+ if (request_irq(irq, systick_interrupt,
109
+ IRQF_PERCPU | IRQF_TIMER, name, &systick.dev))
110
+ pr_err("Failed to request irq %d (%s)\n", irq, name);
111
+ }
113112 sdev->irq_requested = 1;
114113 iowrite32(CFG_EXT_STK_EN | CFG_CNT_EN,
115114 systick.membase + SYSTICK_CONFIG);
....@@ -125,7 +124,6 @@
125124 if (!systick.membase)
126125 return -ENXIO;
127126
128
- systick_irqaction.name = np->name;
129127 systick.dev.name = np->name;
130128 clockevents_calc_mult_shift(&systick.dev, SYSTICK_FREQ, 60);
131129 systick.dev.max_delta_ns = clockevent_delta2ns(0x7fff, &systick.dev);
....@@ -134,7 +132,7 @@
134132 systick.dev.min_delta_ticks = 0x3;
135133 systick.dev.irq = irq_of_parse_and_map(np, 0);
136134 if (!systick.dev.irq) {
137
- pr_err("%s: request_irq failed", np->name);
135
+ pr_err("%pOFn: request_irq failed", np);
138136 return -EINVAL;
139137 }
140138
....@@ -146,8 +144,8 @@
146144
147145 clockevents_register_device(&systick.dev);
148146
149
- pr_info("%s: running - mult: %d, shift: %d\n",
150
- np->name, systick.dev.mult, systick.dev.shift);
147
+ pr_info("%pOFn: running - mult: %d, shift: %d\n",
148
+ np, systick.dev.mult, systick.dev.shift);
151149
152150 return 0;
153151 }