Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
deb36970
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,发现更多精彩内容 >>
提交
deb36970
编写于
3月 23, 2005
作者:
G
gregkh@suse.de
提交者:
Greg Kroah-Hartman
6月 20, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] class: convert drivers/block/* to use the new class api instead of class_simple
Signed-off-by:
N
Greg Kroah-Hartman
<
gregkh@suse.de
>
上级
619e666b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
22 deletion
+22
-22
drivers/block/aoe/aoechr.c
drivers/block/aoe/aoechr.c
+5
-5
drivers/block/paride/pg.c
drivers/block/paride/pg.c
+7
-7
drivers/block/paride/pt.c
drivers/block/paride/pt.c
+10
-10
未找到文件。
drivers/block/aoe/aoechr.c
浏览文件 @
deb36970
...
...
@@ -36,7 +36,7 @@ static int emsgs_head_idx, emsgs_tail_idx;
static
struct
semaphore
emsgs_sema
;
static
spinlock_t
emsgs_lock
;
static
int
nblocked_emsgs_readers
;
static
struct
class
_simple
*
aoe_class
;
static
struct
class
*
aoe_class
;
static
struct
aoe_chardev
chardevs
[]
=
{
{
MINOR_ERR
,
"err"
},
{
MINOR_DISCOVER
,
"discover"
},
...
...
@@ -218,13 +218,13 @@ aoechr_init(void)
}
sema_init
(
&
emsgs_sema
,
0
);
spin_lock_init
(
&
emsgs_lock
);
aoe_class
=
class_
simple_
create
(
THIS_MODULE
,
"aoe"
);
aoe_class
=
class_create
(
THIS_MODULE
,
"aoe"
);
if
(
IS_ERR
(
aoe_class
))
{
unregister_chrdev
(
AOE_MAJOR
,
"aoechr"
);
return
PTR_ERR
(
aoe_class
);
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
chardevs
);
++
i
)
class_
simple_device_add
(
aoe_class
,
class_
device_create
(
aoe_class
,
MKDEV
(
AOE_MAJOR
,
chardevs
[
i
].
minor
),
NULL
,
chardevs
[
i
].
name
);
...
...
@@ -237,8 +237,8 @@ aoechr_exit(void)
int
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
chardevs
);
++
i
)
class_
simple_device_remove
(
MKDEV
(
AOE_MAJOR
,
chardevs
[
i
].
minor
));
class_
simple_
destroy
(
aoe_class
);
class_
device_destroy
(
aoe_class
,
MKDEV
(
AOE_MAJOR
,
chardevs
[
i
].
minor
));
class_destroy
(
aoe_class
);
unregister_chrdev
(
AOE_MAJOR
,
"aoechr"
);
}
drivers/block/paride/pg.c
浏览文件 @
deb36970
...
...
@@ -222,7 +222,7 @@ static int pg_identify(struct pg *dev, int log);
static
char
pg_scratch
[
512
];
/* scratch block buffer */
static
struct
class
_simple
*
pg_class
;
static
struct
class
*
pg_class
;
/* kernel glue structures */
...
...
@@ -666,7 +666,7 @@ static int __init pg_init(void)
err
=
-
1
;
goto
out
;
}
pg_class
=
class_
simple_
create
(
THIS_MODULE
,
"pg"
);
pg_class
=
class_create
(
THIS_MODULE
,
"pg"
);
if
(
IS_ERR
(
pg_class
))
{
err
=
PTR_ERR
(
pg_class
);
goto
out_chrdev
;
...
...
@@ -675,7 +675,7 @@ static int __init pg_init(void)
for
(
unit
=
0
;
unit
<
PG_UNITS
;
unit
++
)
{
struct
pg
*
dev
=
&
devices
[
unit
];
if
(
dev
->
present
)
{
class_
simple_device_add
(
pg_class
,
MKDEV
(
major
,
unit
),
class_
device_create
(
pg_class
,
MKDEV
(
major
,
unit
),
NULL
,
"pg%u"
,
unit
);
err
=
devfs_mk_cdev
(
MKDEV
(
major
,
unit
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"pg/%u"
,
...
...
@@ -688,8 +688,8 @@ static int __init pg_init(void)
goto
out
;
out_class:
class_
simple_device_remove
(
MKDEV
(
major
,
unit
));
class_
simple_
destroy
(
pg_class
);
class_
device_destroy
(
pg_class
,
MKDEV
(
major
,
unit
));
class_destroy
(
pg_class
);
out_chrdev:
unregister_chrdev
(
major
,
"pg"
);
out:
...
...
@@ -703,11 +703,11 @@ static void __exit pg_exit(void)
for
(
unit
=
0
;
unit
<
PG_UNITS
;
unit
++
)
{
struct
pg
*
dev
=
&
devices
[
unit
];
if
(
dev
->
present
)
{
class_
simple_device_remove
(
MKDEV
(
major
,
unit
));
class_
device_destroy
(
pg_class
,
MKDEV
(
major
,
unit
));
devfs_remove
(
"pg/%u"
,
unit
);
}
}
class_
simple_
destroy
(
pg_class
);
class_destroy
(
pg_class
);
devfs_remove
(
"pg"
);
unregister_chrdev
(
major
,
name
);
...
...
drivers/block/paride/pt.c
浏览文件 @
deb36970
...
...
@@ -242,7 +242,7 @@ static struct file_operations pt_fops = {
};
/* sysfs class support */
static
struct
class
_simple
*
pt_class
;
static
struct
class
*
pt_class
;
static
inline
int
status_reg
(
struct
pi_adapter
*
pi
)
{
...
...
@@ -963,7 +963,7 @@ static int __init pt_init(void)
err
=
-
1
;
goto
out
;
}
pt_class
=
class_
simple_
create
(
THIS_MODULE
,
"pt"
);
pt_class
=
class_create
(
THIS_MODULE
,
"pt"
);
if
(
IS_ERR
(
pt_class
))
{
err
=
PTR_ERR
(
pt_class
);
goto
out_chrdev
;
...
...
@@ -972,29 +972,29 @@ static int __init pt_init(void)
devfs_mk_dir
(
"pt"
);
for
(
unit
=
0
;
unit
<
PT_UNITS
;
unit
++
)
if
(
pt
[
unit
].
present
)
{
class_
simple_device_add
(
pt_class
,
MKDEV
(
major
,
unit
),
class_
device_create
(
pt_class
,
MKDEV
(
major
,
unit
),
NULL
,
"pt%d"
,
unit
);
err
=
devfs_mk_cdev
(
MKDEV
(
major
,
unit
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"pt/%d"
,
unit
);
if
(
err
)
{
class_
simple_device_remove
(
MKDEV
(
major
,
unit
));
class_
device_destroy
(
pt_class
,
MKDEV
(
major
,
unit
));
goto
out_class
;
}
class_
simple_device_add
(
pt_class
,
MKDEV
(
major
,
unit
+
128
),
class_
device_create
(
pt_class
,
MKDEV
(
major
,
unit
+
128
),
NULL
,
"pt%dn"
,
unit
);
err
=
devfs_mk_cdev
(
MKDEV
(
major
,
unit
+
128
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"pt/%dn"
,
unit
);
if
(
err
)
{
class_
simple_device_remove
(
MKDEV
(
major
,
unit
+
128
));
class_
device_destroy
(
pt_class
,
MKDEV
(
major
,
unit
+
128
));
goto
out_class
;
}
}
goto
out
;
out_class:
class_
simple_
destroy
(
pt_class
);
class_destroy
(
pt_class
);
out_chrdev:
unregister_chrdev
(
major
,
"pt"
);
out:
...
...
@@ -1006,12 +1006,12 @@ static void __exit pt_exit(void)
int
unit
;
for
(
unit
=
0
;
unit
<
PT_UNITS
;
unit
++
)
if
(
pt
[
unit
].
present
)
{
class_
simple_device_remove
(
MKDEV
(
major
,
unit
));
class_
device_destroy
(
pt_class
,
MKDEV
(
major
,
unit
));
devfs_remove
(
"pt/%d"
,
unit
);
class_
simple_device_remove
(
MKDEV
(
major
,
unit
+
128
));
class_
device_destroy
(
pt_class
,
MKDEV
(
major
,
unit
+
128
));
devfs_remove
(
"pt/%dn"
,
unit
);
}
class_
simple_
destroy
(
pt_class
);
class_destroy
(
pt_class
);
devfs_remove
(
"pt"
);
unregister_chrdev
(
major
,
name
);
for
(
unit
=
0
;
unit
<
PT_UNITS
;
unit
++
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录