Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
b7c76151
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b7c76151
编写于
6月 22, 2009
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
i7core_edac: Improve error handling
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
上级
1c6fed80
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
11 deletion
+21
-11
drivers/edac/i7core_edac.c
drivers/edac/i7core_edac.c
+21
-11
未找到文件。
drivers/edac/i7core_edac.c
浏览文件 @
b7c76151
...
...
@@ -328,8 +328,10 @@ static int i7core_get_active_channels(int *channels)
}
}
if
(
!
pdev
)
if
(
!
pdev
)
{
i7core_printk
(
KERN_ERR
,
"Couldn't find fn 3.0!!!
\n
"
);
return
-
ENODEV
;
}
/* Device 3 function 0 reads */
pci_read_config_dword
(
pdev
,
MC_STATUS
,
&
status
);
...
...
@@ -1109,16 +1111,19 @@ static int __devinit i7core_probe(struct pci_dev *pdev,
int
num_channels
=
0
;
int
num_csrows
;
int
dev_idx
=
id
->
driver_data
;
int
rc
;
if
(
unlikely
(
dev_idx
>=
ARRAY_SIZE
(
i7core_devs
)))
return
-
EINVAL
;
/* get the pci devices we want to reserve for our use */
if
(
unlikely
(
i7core_get_devices
()
<
0
))
return
-
ENODEV
;
rc
=
i7core_get_devices
();
if
(
unlikely
(
rc
<
0
))
return
rc
;
/* Check the number of active and not disabled channels */
if
(
unlikely
(
i7core_get_active_channels
(
&
num_channels
))
<
0
)
rc
=
i7core_get_active_channels
(
&
num_channels
);
if
(
unlikely
(
rc
<
0
))
goto
fail0
;
/* FIXME: we currently don't know the number of csrows */
...
...
@@ -1126,8 +1131,10 @@ static int __devinit i7core_probe(struct pci_dev *pdev,
/* allocate a new MC control structure */
mci
=
edac_mc_alloc
(
sizeof
(
*
pvt
),
num_csrows
,
num_channels
,
0
);
if
(
unlikely
(
!
mci
))
return
-
ENOMEM
;
if
(
unlikely
(
!
mci
))
{
rc
=
-
ENOMEM
;
goto
fail0
;
}
debugf0
(
"MC: "
__FILE__
": %s(): mci = %p
\n
"
,
__func__
,
mci
);
...
...
@@ -1150,19 +1157,22 @@ static int __devinit i7core_probe(struct pci_dev *pdev,
mci
->
edac_check
=
i7core_check_error
;
/* Store pci devices at mci for faster access */
if
(
unlikely
(
mci_bind_devs
(
mci
))
<
0
)
rc
=
mci_bind_devs
(
mci
);
if
(
unlikely
(
rc
<
0
))
goto
fail1
;
/* Get dimm basic config */
get_dimm_config
(
mci
);
/* add this new MC control structure to EDAC's list of MCs */
if
(
unlikely
(
edac_mc_add_mc
(
mci
))
<
0
)
{
if
(
unlikely
(
edac_mc_add_mc
(
mci
)))
{
debugf0
(
"MC: "
__FILE__
": %s(): failed edac_mc_add_mc()
\n
"
,
__func__
);
/* FIXME: perhaps some code should go here that disables error
* reporting if we just enabled it
*/
rc
=
-
EINVAL
;
goto
fail1
;
}
...
...
@@ -1190,11 +1200,11 @@ static int __devinit i7core_probe(struct pci_dev *pdev,
return
0
;
fail1:
i7core_put_devices
(
);
edac_mc_free
(
mci
);
fail0:
edac_mc_free
(
mci
);
return
-
ENODEV
;
i7core_put_devices
(
);
return
rc
;
}
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录