Skip to content

Commit 1aff44a

Browse files
robherringstffrdhrn
authored andcommitted
openrisc: Use common of_get_cpu_node() instead of open-coding
The common of_get_cpu_node() is equivalent to setup_find_cpu_node(), so use it instead. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Stafford Horne <shorne@gmail.com>
1 parent 197b6b6 commit 1aff44a

1 file changed

Lines changed: 2 additions & 17 deletions

File tree

arch/openrisc/kernel/setup.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,6 @@ static void print_cpuinfo(void)
152152
printk(KERN_INFO "-- custom unit(s)\n");
153153
}
154154

155-
static struct device_node *setup_find_cpu_node(int cpu)
156-
{
157-
u32 hwid;
158-
struct device_node *cpun;
159-
160-
for_each_of_cpu_node(cpun) {
161-
if (of_property_read_u32(cpun, "reg", &hwid))
162-
continue;
163-
if (hwid == cpu)
164-
return cpun;
165-
}
166-
167-
return NULL;
168-
}
169-
170155
void __init setup_cpuinfo(void)
171156
{
172157
struct device_node *cpu;
@@ -175,7 +160,7 @@ void __init setup_cpuinfo(void)
175160
int cpu_id = smp_processor_id();
176161
struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[cpu_id];
177162

178-
cpu = setup_find_cpu_node(cpu_id);
163+
cpu = of_get_cpu_node(cpu_id, NULL);
179164
if (!cpu)
180165
panic("Couldn't find CPU%d in device tree...\n", cpu_id);
181166

@@ -255,7 +240,7 @@ static inline unsigned long extract_value(unsigned long reg, unsigned long mask)
255240
void calibrate_delay(void)
256241
{
257242
const int *val;
258-
struct device_node *cpu = setup_find_cpu_node(smp_processor_id());
243+
struct device_node *cpu = of_get_cpu_node(smp_processor_id(), NULL);
259244

260245
val = of_get_property(cpu, "clock-frequency", NULL);
261246
if (!val)

0 commit comments

Comments
 (0)