Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
6448c097
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
6448c097
编写于
10月 03, 2017
作者:
R
Rob Herring
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dt-printf-v2' into HEAD
上级
0c37c56d
a7e4cfb0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
77 deletion
+18
-77
arch/powerpc/platforms/pseries/dlpar.c
arch/powerpc/platforms/pseries/dlpar.c
+6
-18
arch/powerpc/platforms/pseries/reconfig.c
arch/powerpc/platforms/pseries/reconfig.c
+1
-1
drivers/of/fdt.c
drivers/of/fdt.c
+11
-58
未找到文件。
arch/powerpc/platforms/pseries/dlpar.c
浏览文件 @
6448c097
...
...
@@ -75,24 +75,17 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa)
return
prop
;
}
static
struct
device_node
*
dlpar_parse_cc_node
(
struct
cc_workarea
*
ccwa
,
const
char
*
path
)
static
struct
device_node
*
dlpar_parse_cc_node
(
struct
cc_workarea
*
ccwa
)
{
struct
device_node
*
dn
;
char
*
name
;
/* If parent node path is "/" advance path to NULL terminator to
* prevent double leading slashs in full_name.
*/
if
(
!
path
[
1
])
path
++
;
const
char
*
name
;
dn
=
kzalloc
(
sizeof
(
*
dn
),
GFP_KERNEL
);
if
(
!
dn
)
return
NULL
;
name
=
(
char
*
)
ccwa
+
be32_to_cpu
(
ccwa
->
name_offset
);
dn
->
full_name
=
k
asprintf
(
GFP_KERNEL
,
"%s/%s"
,
path
,
name
);
name
=
(
c
onst
c
har
*
)
ccwa
+
be32_to_cpu
(
ccwa
->
name_offset
);
dn
->
full_name
=
k
strdup
(
name
,
GFP_KERNEL
);
if
(
!
dn
->
full_name
)
{
kfree
(
dn
);
return
NULL
;
...
...
@@ -148,7 +141,6 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
struct
property
*
last_property
=
NULL
;
struct
cc_workarea
*
ccwa
;
char
*
data_buf
;
const
char
*
parent_path
=
parent
->
full_name
;
int
cc_token
;
int
rc
=
-
1
;
...
...
@@ -182,7 +174,7 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
break
;
case
NEXT_SIBLING
:
dn
=
dlpar_parse_cc_node
(
ccwa
,
parent_path
);
dn
=
dlpar_parse_cc_node
(
ccwa
);
if
(
!
dn
)
goto
cc_error
;
...
...
@@ -192,10 +184,7 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
break
;
case
NEXT_CHILD
:
if
(
first_dn
)
parent_path
=
last_dn
->
full_name
;
dn
=
dlpar_parse_cc_node
(
ccwa
,
parent_path
);
dn
=
dlpar_parse_cc_node
(
ccwa
);
if
(
!
dn
)
goto
cc_error
;
...
...
@@ -226,7 +215,6 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
case
PREV_PARENT
:
last_dn
=
last_dn
->
parent
;
parent_path
=
last_dn
->
parent
->
full_name
;
break
;
case
CALL_AGAIN
:
...
...
arch/powerpc/platforms/pseries/reconfig.c
浏览文件 @
6448c097
...
...
@@ -33,7 +33,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist
if
(
!
np
)
goto
out_err
;
np
->
full_name
=
kstrdup
(
path
,
GFP_KERNEL
);
np
->
full_name
=
kstrdup
(
kbasename
(
path
)
,
GFP_KERNEL
);
if
(
!
np
->
full_name
)
goto
out_err
;
...
...
drivers/of/fdt.c
浏览文件 @
6448c097
...
...
@@ -266,74 +266,32 @@ static void populate_properties(const void *blob,
*
pprev
=
NULL
;
}
static
unsigned
int
populate_node
(
const
void
*
blob
,
int
offset
,
void
**
mem
,
struct
device_node
*
dad
,
unsigned
int
fpsize
,
struct
device_node
**
pnp
,
bool
dryrun
)
static
bool
populate_node
(
const
void
*
blob
,
int
offset
,
void
**
mem
,
struct
device_node
*
dad
,
struct
device_node
**
pnp
,
bool
dryrun
)
{
struct
device_node
*
np
;
const
char
*
pathp
;
unsigned
int
l
,
allocl
;
int
new_format
=
0
;
pathp
=
fdt_get_name
(
blob
,
offset
,
&
l
);
if
(
!
pathp
)
{
*
pnp
=
NULL
;
return
0
;
return
false
;
}
allocl
=
++
l
;
/* version 0x10 has a more compact unit name here instead of the full
* path. we accumulate the full path size using "fpsize", we'll rebuild
* it later. We detect this because the first character of the name is
* not '/'.
*/
if
((
*
pathp
)
!=
'/'
)
{
new_format
=
1
;
if
(
fpsize
==
0
)
{
/* root node: special case. fpsize accounts for path
* plus terminating zero. root node only has '/', so
* fpsize should be 2, but we want to avoid the first
* level nodes to have two '/' so we use fpsize 1 here
*/
fpsize
=
1
;
allocl
=
2
;
l
=
1
;
pathp
=
""
;
}
else
{
/* account for '/' and path size minus terminal 0
* already in 'l'
*/
fpsize
+=
l
;
allocl
=
fpsize
;
}
}
np
=
unflatten_dt_alloc
(
mem
,
sizeof
(
struct
device_node
)
+
allocl
,
__alignof__
(
struct
device_node
));
if
(
!
dryrun
)
{
char
*
fn
;
of_node_init
(
np
);
np
->
full_name
=
fn
=
((
char
*
)
np
)
+
sizeof
(
*
np
);
if
(
new_format
)
{
/* rebuild full path for new format */
if
(
dad
&&
dad
->
parent
)
{
strcpy
(
fn
,
dad
->
full_name
);
#ifdef DEBUG
if
((
strlen
(
fn
)
+
l
+
1
)
!=
allocl
)
{
pr_debug
(
"%s: p: %d, l: %d, a: %d
\n
"
,
pathp
,
(
int
)
strlen
(
fn
),
l
,
allocl
);
}
#endif
fn
+=
strlen
(
fn
);
}
*
(
fn
++
)
=
'/'
;
}
memcpy
(
fn
,
pathp
,
l
);
if
(
dad
!=
NULL
)
{
...
...
@@ -355,7 +313,7 @@ static unsigned int populate_node(const void *blob,
}
*
pnp
=
np
;
return
fpsiz
e
;
return
tru
e
;
}
static
void
reverse_nodes
(
struct
device_node
*
parent
)
...
...
@@ -399,7 +357,6 @@ static int unflatten_dt_nodes(const void *blob,
struct
device_node
*
root
;
int
offset
=
0
,
depth
=
0
,
initial_depth
=
0
;
#define FDT_MAX_DEPTH 64
unsigned
int
fpsizes
[
FDT_MAX_DEPTH
];
struct
device_node
*
nps
[
FDT_MAX_DEPTH
];
void
*
base
=
mem
;
bool
dryrun
=
!
base
;
...
...
@@ -418,7 +375,6 @@ static int unflatten_dt_nodes(const void *blob,
depth
=
initial_depth
=
1
;
root
=
dad
;
fpsizes
[
depth
]
=
dad
?
strlen
(
of_node_full_name
(
dad
))
:
0
;
nps
[
depth
]
=
dad
;
for
(
offset
=
0
;
...
...
@@ -427,11 +383,8 @@ static int unflatten_dt_nodes(const void *blob,
if
(
WARN_ON_ONCE
(
depth
>=
FDT_MAX_DEPTH
))
continue
;
fpsizes
[
depth
+
1
]
=
populate_node
(
blob
,
offset
,
&
mem
,
nps
[
depth
],
fpsizes
[
depth
],
&
nps
[
depth
+
1
],
dryrun
);
if
(
!
fpsizes
[
depth
+
1
])
if
(
!
populate_node
(
blob
,
offset
,
&
mem
,
nps
[
depth
],
&
nps
[
depth
+
1
],
dryrun
))
return
mem
-
base
;
if
(
!
dryrun
&&
nodepp
&&
!*
nodepp
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录