Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
7d9439d5
Commit
7d9439d5
authored
Dec 05, 2008
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sparc: Move create_node() and friends into prom_common.c
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
06c0db72
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
78 deletions
+42
-78
arch/sparc/kernel/prom.h
arch/sparc/kernel/prom.h
+2
-1
arch/sparc/kernel/prom_32.c
arch/sparc/kernel/prom_32.c
+0
-38
arch/sparc/kernel/prom_64.c
arch/sparc/kernel/prom_64.c
+0
-38
arch/sparc/kernel/prom_common.c
arch/sparc/kernel/prom_common.c
+40
-1
No files found.
arch/sparc/kernel/prom.h
View file @
7d9439d5
...
...
@@ -15,6 +15,7 @@ extern void irq_trans_init(struct device_node *dp);
extern
unsigned
int
prom_unique_id
;
extern
struct
property
*
__init
build_prop_list
(
phandle
node
);
extern
struct
device_node
*
__init
create_node
(
phandle
node
,
struct
device_node
*
parent
);
#endif
/* __PROM_H */
arch/sparc/kernel/prom_32.c
View file @
7d9439d5
...
...
@@ -196,44 +196,6 @@ static char * __init build_full_name(struct device_node *dp)
return
n
;
}
static
char
*
__init
get_one_property
(
phandle
node
,
const
char
*
name
)
{
char
*
buf
=
"<NULL>"
;
int
len
;
len
=
prom_getproplen
(
node
,
name
);
if
(
len
>
0
)
{
buf
=
prom_early_alloc
(
len
);
len
=
prom_getproperty
(
node
,
name
,
buf
,
len
);
}
return
buf
;
}
static
struct
device_node
*
__init
create_node
(
phandle
node
,
struct
device_node
*
parent
)
{
struct
device_node
*
dp
;
if
(
!
node
)
return
NULL
;
dp
=
prom_early_alloc
(
sizeof
(
*
dp
));
dp
->
unique_id
=
prom_unique_id
++
;
dp
->
parent
=
parent
;
kref_init
(
&
dp
->
kref
);
dp
->
name
=
get_one_property
(
node
,
"name"
);
dp
->
type
=
get_one_property
(
node
,
"device_type"
);
dp
->
node
=
node
;
/* Build interrupts later... */
dp
->
properties
=
build_prop_list
(
node
);
return
dp
;
}
static
struct
device_node
*
__init
build_tree
(
struct
device_node
*
parent
,
phandle
node
,
struct
device_node
***
nextp
)
{
struct
device_node
*
dp
;
...
...
arch/sparc/kernel/prom_64.c
View file @
7d9439d5
...
...
@@ -399,44 +399,6 @@ static char * __init build_full_name(struct device_node *dp)
return
n
;
}
static
char
*
__init
get_one_property
(
phandle
node
,
const
char
*
name
)
{
char
*
buf
=
"<NULL>"
;
int
len
;
len
=
prom_getproplen
(
node
,
name
);
if
(
len
>
0
)
{
buf
=
prom_early_alloc
(
len
);
len
=
prom_getproperty
(
node
,
name
,
buf
,
len
);
}
return
buf
;
}
static
struct
device_node
*
__init
create_node
(
phandle
node
,
struct
device_node
*
parent
)
{
struct
device_node
*
dp
;
if
(
!
node
)
return
NULL
;
dp
=
prom_early_alloc
(
sizeof
(
*
dp
));
dp
->
unique_id
=
prom_unique_id
++
;
dp
->
parent
=
parent
;
kref_init
(
&
dp
->
kref
);
dp
->
name
=
get_one_property
(
node
,
"name"
);
dp
->
type
=
get_one_property
(
node
,
"device_type"
);
dp
->
node
=
node
;
dp
->
properties
=
build_prop_list
(
node
);
irq_trans_init
(
dp
);
return
dp
;
}
static
struct
device_node
*
__init
build_tree
(
struct
device_node
*
parent
,
phandle
node
,
struct
device_node
***
nextp
)
{
struct
device_node
*
ret
=
NULL
,
*
prev_sibling
=
NULL
;
...
...
arch/sparc/kernel/prom_common.c
View file @
7d9439d5
...
...
@@ -184,7 +184,7 @@ static struct property * __init build_one_prop(phandle node, char *prev,
return
p
;
}
struct
property
*
__init
build_prop_list
(
phandle
node
)
st
atic
st
ruct
property
*
__init
build_prop_list
(
phandle
node
)
{
struct
property
*
head
,
*
tail
;
...
...
@@ -201,3 +201,42 @@ struct property * __init build_prop_list(phandle node)
return
head
;
}
static
char
*
__init
get_one_property
(
phandle
node
,
const
char
*
name
)
{
char
*
buf
=
"<NULL>"
;
int
len
;
len
=
prom_getproplen
(
node
,
name
);
if
(
len
>
0
)
{
buf
=
prom_early_alloc
(
len
);
len
=
prom_getproperty
(
node
,
name
,
buf
,
len
);
}
return
buf
;
}
struct
device_node
*
__init
create_node
(
phandle
node
,
struct
device_node
*
parent
)
{
struct
device_node
*
dp
;
if
(
!
node
)
return
NULL
;
dp
=
prom_early_alloc
(
sizeof
(
*
dp
));
dp
->
unique_id
=
prom_unique_id
++
;
dp
->
parent
=
parent
;
kref_init
(
&
dp
->
kref
);
dp
->
name
=
get_one_property
(
node
,
"name"
);
dp
->
type
=
get_one_property
(
node
,
"device_type"
);
dp
->
node
=
node
;
/* Build interrupts later... */
dp
->
properties
=
build_prop_list
(
node
);
return
dp
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment