Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32768
b: refs/heads/master
c: c2d3bff
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jul 21, 2006
1 parent 5ae4f03 commit 8fa1a9f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2f72ba43581890d003427053ebe4dfaa14e5f4b0
refs/heads/master: c2d3bffebc2cb651ed33abae2434f85cd503a498
25 changes: 7 additions & 18 deletions trunk/arch/sparc/kernel/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <asm/page.h>
#include <asm/oplib.h>
#include <asm/prom.h>
#include <asm/smp.h>
#include <asm/system.h>
#include <asm/cpudata.h>
Expand All @@ -34,12 +35,6 @@ static int check_cpu_node(int nd, int *cur_inst,
int (*compare)(int, int, void *), void *compare_arg,
int *prom_node, int *mid)
{
char node_str[128];

prom_getstring(nd, "device_type", node_str, sizeof(node_str));
if (strcmp(node_str, "cpu"))
return -ENODEV;

if (!compare(nd, *cur_inst, compare_arg)) {
if (prom_node)
*prom_node = nd;
Expand All @@ -59,20 +54,14 @@ static int check_cpu_node(int nd, int *cur_inst,
static int __cpu_find_by(int (*compare)(int, int, void *), void *compare_arg,
int *prom_node, int *mid)
{
int nd, cur_inst, err;
struct device_node *dp;
int cur_inst;

nd = prom_root_node;
cur_inst = 0;

err = check_cpu_node(nd, &cur_inst, compare, compare_arg,
prom_node, mid);
if (!err)
return 0;

nd = prom_getchild(nd);
while ((nd = prom_getsibling(nd)) != 0) {
err = check_cpu_node(nd, &cur_inst, compare, compare_arg,
prom_node, mid);
for_each_node_by_type(dp, "cpu") {
int err = check_cpu_node(dp->node, &cur_inst,
compare, compare_arg,
prom_node, mid);
if (!err)
return 0;
}
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/sparc64/kernel/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ static int check_cpu_node(struct device_node *dp, int *cur_inst,
void *compare_arg,
struct device_node **dev_node, int *mid)
{
if (strcmp(dp->type, "cpu"))
return -ENODEV;

if (!compare(dp, *cur_inst, compare_arg)) {
if (dev_node)
*dev_node = dp;
Expand Down

0 comments on commit 8fa1a9f

Please sign in to comment.