Skip to content

Commit 5a26cd6

Browse files
committed
microblaze: Use of_find_compatible_node for timer and intc
Calling of_find_compatible_node instead of calling private code which does the same. Signed-off-by: Michal Simek <monstr@monstr.eu>
1 parent eecb207 commit 5a26cd6

2 files changed

Lines changed: 8 additions & 26 deletions

File tree

‎arch/microblaze/kernel/intc.c‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ unsigned int get_irq(struct pt_regs *regs)
9999

100100
void __init init_IRQ(void)
101101
{
102-
u32 i, j, intr_type;
102+
u32 i, intr_type;
103103
struct device_node *intc = NULL;
104104
#ifdef CONFIG_SELFMOD_INTC
105105
unsigned int intc_baseaddr = 0;
@@ -113,16 +113,7 @@ void __init init_IRQ(void)
113113
0
114114
};
115115
#endif
116-
const char * const intc_list[] = {
117-
"xlnx,xps-intc-1.00.a",
118-
NULL
119-
};
120-
121-
for (j = 0; intc_list[j] != NULL; j++) {
122-
intc = of_find_compatible_node(NULL, NULL, intc_list[j]);
123-
if (intc)
124-
break;
125-
}
116+
intc = of_find_compatible_node(NULL, NULL, "xlnx,xps-intc-1.00.a");
126117
BUG_ON(!intc);
127118

128119
intc_baseaddr = be32_to_cpup(of_get_property(intc,
@@ -140,8 +131,8 @@ void __init init_IRQ(void)
140131
#ifdef CONFIG_SELFMOD_INTC
141132
selfmod_function((int *) arr_func, intc_baseaddr);
142133
#endif
143-
printk(KERN_INFO "%s #0 at 0x%08x, num_irq=%d, edge=0x%x\n",
144-
intc_list[j], intc_baseaddr, nr_irq, intr_type);
134+
printk(KERN_INFO "XPS intc #0 at 0x%08x, num_irq=%d, edge=0x%x\n",
135+
intc_baseaddr, nr_irq, intr_mask);
145136

146137
/*
147138
* Disable all external interrupts until they are

‎arch/microblaze/kernel/timer.c‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static int timer_initialized;
243243

244244
void __init time_init(void)
245245
{
246-
u32 irq, i = 0;
246+
u32 irq;
247247
u32 timer_num = 1;
248248
struct device_node *timer = NULL;
249249
const void *prop;
@@ -258,16 +258,7 @@ void __init time_init(void)
258258
0
259259
};
260260
#endif
261-
const char * const timer_list[] = {
262-
"xlnx,xps-timer-1.00.a",
263-
NULL
264-
};
265-
266-
for (i = 0; timer_list[i] != NULL; i++) {
267-
timer = of_find_compatible_node(NULL, NULL, timer_list[i]);
268-
if (timer)
269-
break;
270-
}
261+
timer = of_find_compatible_node(NULL, NULL, "xlnx,xps-timer-1.00.a");
271262
BUG_ON(!timer);
272263

273264
timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL));
@@ -283,8 +274,8 @@ void __init time_init(void)
283274
#ifdef CONFIG_SELFMOD_TIMER
284275
selfmod_function((int *) arr_func, timer_baseaddr);
285276
#endif
286-
printk(KERN_INFO "%s #0 at 0x%08x, irq=%d\n",
287-
timer_list[i], timer_baseaddr, irq);
277+
printk(KERN_INFO "XPS timer #0 at 0x%08x, irq=%d\n",
278+
timer_baseaddr, irq);
288279

289280
/* If there is clock-frequency property than use it */
290281
prop = of_get_property(timer, "clock-frequency", NULL);

0 commit comments

Comments
 (0)