Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
8874b414
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
8874b414
编写于
3月 23, 2005
作者:
G
gregkh@suse.de
提交者:
Greg Kroah-Hartman
6月 20, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] class: convert arch/* to use the new class api instead of class_simple
Signed-off-by:
N
Greg Kroah-Hartman
<
gregkh@suse.de
>
上级
d253878b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
22 deletion
+22
-22
arch/i386/kernel/cpuid.c
arch/i386/kernel/cpuid.c
+11
-11
arch/i386/kernel/msr.c
arch/i386/kernel/msr.c
+11
-11
未找到文件。
arch/i386/kernel/cpuid.c
浏览文件 @
8874b414
...
...
@@ -45,7 +45,7 @@
#include <asm/uaccess.h>
#include <asm/system.h>
static
struct
class
_simple
*
cpuid_class
;
static
struct
class
*
cpuid_class
;
#ifdef CONFIG_SMP
...
...
@@ -158,12 +158,12 @@ static struct file_operations cpuid_fops = {
.
open
=
cpuid_open
,
};
static
int
cpuid_class_
simple_device_add
(
int
i
)
static
int
cpuid_class_
device_create
(
int
i
)
{
int
err
=
0
;
struct
class_device
*
class_err
;
class_err
=
class_
simple_device_add
(
cpuid_class
,
MKDEV
(
CPUID_MAJOR
,
i
),
NULL
,
"cpu%d"
,
i
);
class_err
=
class_
device_create
(
cpuid_class
,
MKDEV
(
CPUID_MAJOR
,
i
),
NULL
,
"cpu%d"
,
i
);
if
(
IS_ERR
(
class_err
))
err
=
PTR_ERR
(
class_err
);
return
err
;
...
...
@@ -175,10 +175,10 @@ static int __devinit cpuid_class_cpu_callback(struct notifier_block *nfb, unsign
switch
(
action
)
{
case
CPU_ONLINE
:
cpuid_class_
simple_device_add
(
cpu
);
cpuid_class_
device_create
(
cpu
);
break
;
case
CPU_DEAD
:
class_
simple_device_remove
(
MKDEV
(
CPUID_MAJOR
,
cpu
));
class_
device_destroy
(
cpuid_class
,
MKDEV
(
CPUID_MAJOR
,
cpu
));
break
;
}
return
NOTIFY_OK
;
...
...
@@ -200,13 +200,13 @@ static int __init cpuid_init(void)
err
=
-
EBUSY
;
goto
out
;
}
cpuid_class
=
class_
simple_
create
(
THIS_MODULE
,
"cpuid"
);
cpuid_class
=
class_create
(
THIS_MODULE
,
"cpuid"
);
if
(
IS_ERR
(
cpuid_class
))
{
err
=
PTR_ERR
(
cpuid_class
);
goto
out_chrdev
;
}
for_each_online_cpu
(
i
)
{
err
=
cpuid_class_
simple_device_add
(
i
);
err
=
cpuid_class_
device_create
(
i
);
if
(
err
!=
0
)
goto
out_class
;
}
...
...
@@ -218,9 +218,9 @@ static int __init cpuid_init(void)
out_class:
i
=
0
;
for_each_online_cpu
(
i
)
{
class_
simple_device_remove
(
MKDEV
(
CPUID_MAJOR
,
i
));
class_
device_destroy
(
cpuid_class
,
MKDEV
(
CPUID_MAJOR
,
i
));
}
class_
simple_
destroy
(
cpuid_class
);
class_destroy
(
cpuid_class
);
out_chrdev:
unregister_chrdev
(
CPUID_MAJOR
,
"cpu/cpuid"
);
out:
...
...
@@ -232,8 +232,8 @@ static void __exit cpuid_exit(void)
int
cpu
=
0
;
for_each_online_cpu
(
cpu
)
class_
simple_device_remove
(
MKDEV
(
CPUID_MAJOR
,
cpu
));
class_
simple_
destroy
(
cpuid_class
);
class_
device_destroy
(
cpuid_class
,
MKDEV
(
CPUID_MAJOR
,
cpu
));
class_destroy
(
cpuid_class
);
unregister_chrdev
(
CPUID_MAJOR
,
"cpu/cpuid"
);
unregister_cpu_notifier
(
&
cpuid_class_cpu_notifier
);
}
...
...
arch/i386/kernel/msr.c
浏览文件 @
8874b414
...
...
@@ -44,7 +44,7 @@
#include <asm/uaccess.h>
#include <asm/system.h>
static
struct
class
_simple
*
msr_class
;
static
struct
class
*
msr_class
;
/* Note: "err" is handled in a funny way below. Otherwise one version
of gcc or another breaks. */
...
...
@@ -260,12 +260,12 @@ static struct file_operations msr_fops = {
.
open
=
msr_open
,
};
static
int
msr_class_
simple_device_add
(
int
i
)
static
int
msr_class_
device_create
(
int
i
)
{
int
err
=
0
;
struct
class_device
*
class_err
;
class_err
=
class_
simple_device_add
(
msr_class
,
MKDEV
(
MSR_MAJOR
,
i
),
NULL
,
"msr%d"
,
i
);
class_err
=
class_
device_create
(
msr_class
,
MKDEV
(
MSR_MAJOR
,
i
),
NULL
,
"msr%d"
,
i
);
if
(
IS_ERR
(
class_err
))
err
=
PTR_ERR
(
class_err
);
return
err
;
...
...
@@ -277,10 +277,10 @@ static int __devinit msr_class_cpu_callback(struct notifier_block *nfb, unsigned
switch
(
action
)
{
case
CPU_ONLINE
:
msr_class_
simple_device_add
(
cpu
);
msr_class_
device_create
(
cpu
);
break
;
case
CPU_DEAD
:
class_
simple_device_remove
(
MKDEV
(
MSR_MAJOR
,
cpu
));
class_
device_destroy
(
msr_class
,
MKDEV
(
MSR_MAJOR
,
cpu
));
break
;
}
return
NOTIFY_OK
;
...
...
@@ -302,13 +302,13 @@ static int __init msr_init(void)
err
=
-
EBUSY
;
goto
out
;
}
msr_class
=
class_
simple_
create
(
THIS_MODULE
,
"msr"
);
msr_class
=
class_create
(
THIS_MODULE
,
"msr"
);
if
(
IS_ERR
(
msr_class
))
{
err
=
PTR_ERR
(
msr_class
);
goto
out_chrdev
;
}
for_each_online_cpu
(
i
)
{
err
=
msr_class_
simple_device_add
(
i
);
err
=
msr_class_
device_create
(
i
);
if
(
err
!=
0
)
goto
out_class
;
}
...
...
@@ -320,8 +320,8 @@ static int __init msr_init(void)
out_class:
i
=
0
;
for_each_online_cpu
(
i
)
class_
simple_device_remove
(
MKDEV
(
MSR_MAJOR
,
i
));
class_
simple_
destroy
(
msr_class
);
class_
device_destroy
(
msr_class
,
MKDEV
(
MSR_MAJOR
,
i
));
class_destroy
(
msr_class
);
out_chrdev:
unregister_chrdev
(
MSR_MAJOR
,
"cpu/msr"
);
out:
...
...
@@ -332,8 +332,8 @@ static void __exit msr_exit(void)
{
int
cpu
=
0
;
for_each_online_cpu
(
cpu
)
class_
simple_device_remove
(
MKDEV
(
MSR_MAJOR
,
cpu
));
class_
simple_
destroy
(
msr_class
);
class_
device_destroy
(
msr_class
,
MKDEV
(
MSR_MAJOR
,
cpu
));
class_destroy
(
msr_class
);
unregister_chrdev
(
MSR_MAJOR
,
"cpu/msr"
);
unregister_cpu_notifier
(
&
msr_class_cpu_notifier
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录