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
nexedi
linux
Commits
3ae9a348
Commit
3ae9a348
authored
Jun 29, 2006
by
David S. Miller
Committed by
David S. Miller
Jun 29, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC]: Add of_n_{addr,size}_cells().
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
286bbe87
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
0 deletions
+64
-0
arch/sparc/kernel/prom.c
arch/sparc/kernel/prom.c
+30
-0
arch/sparc64/kernel/prom.c
arch/sparc64/kernel/prom.c
+30
-0
include/asm-sparc/prom.h
include/asm-sparc/prom.h
+2
-0
include/asm-sparc64/prom.h
include/asm-sparc64/prom.h
+2
-0
No files found.
arch/sparc/kernel/prom.c
View file @
3ae9a348
...
...
@@ -190,6 +190,36 @@ int of_getintprop_default(struct device_node *np, const char *name, int def)
}
EXPORT_SYMBOL
(
of_getintprop_default
);
int
of_n_addr_cells
(
struct
device_node
*
np
)
{
int
*
ip
;
do
{
if
(
np
->
parent
)
np
=
np
->
parent
;
ip
=
of_get_property
(
np
,
"#address-cells"
,
NULL
);
if
(
ip
!=
NULL
)
return
*
ip
;
}
while
(
np
->
parent
);
/* No #address-cells property for the root node, default to 2 */
return
2
;
}
EXPORT_SYMBOL
(
of_n_addr_cells
);
int
of_n_size_cells
(
struct
device_node
*
np
)
{
int
*
ip
;
do
{
if
(
np
->
parent
)
np
=
np
->
parent
;
ip
=
of_get_property
(
np
,
"#size-cells"
,
NULL
);
if
(
ip
!=
NULL
)
return
*
ip
;
}
while
(
np
->
parent
);
/* No #size-cells property for the root node, default to 1 */
return
1
;
}
EXPORT_SYMBOL
(
of_n_size_cells
);
int
of_set_property
(
struct
device_node
*
dp
,
const
char
*
name
,
void
*
val
,
int
len
)
{
struct
property
**
prevp
;
...
...
arch/sparc64/kernel/prom.c
View file @
3ae9a348
...
...
@@ -190,6 +190,36 @@ int of_getintprop_default(struct device_node *np, const char *name, int def)
}
EXPORT_SYMBOL
(
of_getintprop_default
);
int
of_n_addr_cells
(
struct
device_node
*
np
)
{
int
*
ip
;
do
{
if
(
np
->
parent
)
np
=
np
->
parent
;
ip
=
of_get_property
(
np
,
"#address-cells"
,
NULL
);
if
(
ip
!=
NULL
)
return
*
ip
;
}
while
(
np
->
parent
);
/* No #address-cells property for the root node, default to 2 */
return
2
;
}
EXPORT_SYMBOL
(
of_n_addr_cells
);
int
of_n_size_cells
(
struct
device_node
*
np
)
{
int
*
ip
;
do
{
if
(
np
->
parent
)
np
=
np
->
parent
;
ip
=
of_get_property
(
np
,
"#size-cells"
,
NULL
);
if
(
ip
!=
NULL
)
return
*
ip
;
}
while
(
np
->
parent
);
/* No #size-cells property for the root node, default to 1 */
return
1
;
}
EXPORT_SYMBOL
(
of_n_size_cells
);
int
of_set_property
(
struct
device_node
*
dp
,
const
char
*
name
,
void
*
val
,
int
len
)
{
struct
property
**
prevp
;
...
...
include/asm-sparc/prom.h
View file @
3ae9a348
...
...
@@ -101,6 +101,8 @@ extern int of_set_property(struct device_node *node, const char *name, void *val
extern
int
of_getintprop_default
(
struct
device_node
*
np
,
const
char
*
name
,
int
def
);
extern
int
of_n_addr_cells
(
struct
device_node
*
np
);
extern
int
of_n_size_cells
(
struct
device_node
*
np
);
extern
void
prom_build_devicetree
(
void
);
...
...
include/asm-sparc64/prom.h
View file @
3ae9a348
...
...
@@ -101,6 +101,8 @@ extern int of_set_property(struct device_node *node, const char *name, void *val
extern
int
of_getintprop_default
(
struct
device_node
*
np
,
const
char
*
name
,
int
def
);
extern
int
of_n_addr_cells
(
struct
device_node
*
np
);
extern
int
of_n_size_cells
(
struct
device_node
*
np
);
extern
void
prom_build_devicetree
(
void
);
...
...
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