Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
d253878b
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看板
提交
d253878b
编写于
3月 23, 2005
作者:
G
gregkh@suse.de
提交者:
Greg Kroah-Hartman
6月 20, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] class: convert drivers/scsi/* to use the new class api instead of class_simple
Signed-off-by:
N
Greg Kroah-Hartman
<
gregkh@suse.de
>
上级
7e25ab91
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
25 deletion
+27
-25
drivers/scsi/osst.c
drivers/scsi/osst.c
+5
-5
drivers/scsi/sg.c
drivers/scsi/sg.c
+7
-7
drivers/scsi/st.c
drivers/scsi/st.c
+15
-13
未找到文件。
drivers/scsi/osst.c
浏览文件 @
d253878b
...
...
@@ -5608,13 +5608,13 @@ static ssize_t osst_filemark_cnt_show(struct class_device *class_dev, char *buf)
CLASS_DEVICE_ATTR
(
file_count
,
S_IRUGO
,
osst_filemark_cnt_show
,
NULL
);
static
struct
class
_simple
*
osst_sysfs_class
;
static
struct
class
*
osst_sysfs_class
;
static
int
osst_sysfs_valid
=
0
;
static
void
osst_sysfs_init
(
void
)
{
osst_sysfs_class
=
class_
simple_
create
(
THIS_MODULE
,
"onstream_tape"
);
osst_sysfs_class
=
class_create
(
THIS_MODULE
,
"onstream_tape"
);
if
(
IS_ERR
(
osst_sysfs_class
)
)
printk
(
KERN_WARNING
"osst :W: Unable to register sysfs class
\n
"
);
else
...
...
@@ -5627,7 +5627,7 @@ static void osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape *
if
(
!
osst_sysfs_valid
)
return
;
osst_class_member
=
class_
simple_device_add
(
osst_sysfs_class
,
dev
,
device
,
"%s"
,
name
);
osst_class_member
=
class_
device_create
(
osst_sysfs_class
,
dev
,
device
,
"%s"
,
name
);
if
(
IS_ERR
(
osst_class_member
))
{
printk
(
KERN_WARNING
"osst :W: Unable to add sysfs class member %s
\n
"
,
name
);
return
;
...
...
@@ -5645,13 +5645,13 @@ static void osst_sysfs_destroy(dev_t dev)
{
if
(
!
osst_sysfs_valid
)
return
;
class_
simple_device_remove
(
dev
);
class_
device_destroy
(
osst_sysfs_class
,
dev
);
}
static
void
osst_sysfs_cleanup
(
void
)
{
if
(
osst_sysfs_valid
)
{
class_
simple_
destroy
(
osst_sysfs_class
);
class_destroy
(
osst_sysfs_class
);
osst_sysfs_valid
=
0
;
}
}
...
...
drivers/scsi/sg.c
浏览文件 @
d253878b
...
...
@@ -1430,7 +1430,7 @@ static struct file_operations sg_fops = {
.
fasync
=
sg_fasync
,
};
static
struct
class
_simple
*
sg_sysfs_class
;
static
struct
class
*
sg_sysfs_class
;
static
int
sg_sysfs_valid
=
0
;
...
...
@@ -1551,13 +1551,13 @@ sg_add(struct class_device *cl_dev)
if
(
sg_sysfs_valid
)
{
struct
class_device
*
sg_class_member
;
sg_class_member
=
class_
simple_device_add
(
sg_sysfs_class
,
sg_class_member
=
class_
device_create
(
sg_sysfs_class
,
MKDEV
(
SCSI_GENERIC_MAJOR
,
k
),
cl_dev
->
dev
,
"%s"
,
disk
->
disk_name
);
if
(
IS_ERR
(
sg_class_member
))
printk
(
KERN_WARNING
"sg_add: "
"class_
simple_device_add
failed
\n
"
);
"class_
device_create
failed
\n
"
);
class_set_devdata
(
sg_class_member
,
sdp
);
error
=
sysfs_create_link
(
&
scsidp
->
sdev_gendev
.
kobj
,
&
sg_class_member
->
kobj
,
"generic"
);
...
...
@@ -1636,7 +1636,7 @@ sg_remove(struct class_device *cl_dev)
if
(
sdp
)
{
sysfs_remove_link
(
&
scsidp
->
sdev_gendev
.
kobj
,
"generic"
);
class_
simple_device_remove
(
MKDEV
(
SCSI_GENERIC_MAJOR
,
k
));
class_
device_destroy
(
sg_sysfs_class
,
MKDEV
(
SCSI_GENERIC_MAJOR
,
k
));
cdev_del
(
sdp
->
cdev
);
sdp
->
cdev
=
NULL
;
devfs_remove
(
"%s/generic"
,
scsidp
->
devfs_name
);
...
...
@@ -1677,7 +1677,7 @@ init_sg(void)
SG_MAX_DEVS
,
"sg"
);
if
(
rc
)
return
rc
;
sg_sysfs_class
=
class_
simple_
create
(
THIS_MODULE
,
"scsi_generic"
);
sg_sysfs_class
=
class_create
(
THIS_MODULE
,
"scsi_generic"
);
if
(
IS_ERR
(
sg_sysfs_class
)
)
{
rc
=
PTR_ERR
(
sg_sysfs_class
);
goto
err_out
;
...
...
@@ -1690,7 +1690,7 @@ init_sg(void)
#endif
/* CONFIG_SCSI_PROC_FS */
return
0
;
}
class_
simple_
destroy
(
sg_sysfs_class
);
class_destroy
(
sg_sysfs_class
);
err_out:
unregister_chrdev_region
(
MKDEV
(
SCSI_GENERIC_MAJOR
,
0
),
SG_MAX_DEVS
);
return
rc
;
...
...
@@ -1703,7 +1703,7 @@ exit_sg(void)
sg_proc_cleanup
();
#endif
/* CONFIG_SCSI_PROC_FS */
scsi_unregister_interface
(
&
sg_interface
);
class_
simple_
destroy
(
sg_sysfs_class
);
class_destroy
(
sg_sysfs_class
);
sg_sysfs_valid
=
0
;
unregister_chrdev_region
(
MKDEV
(
SCSI_GENERIC_MAJOR
,
0
),
SG_MAX_DEVS
);
...
...
drivers/scsi/st.c
浏览文件 @
d253878b
...
...
@@ -84,7 +84,7 @@ static int try_wdio = 1;
static
int
st_dev_max
;
static
int
st_nr_dev
;
static
struct
class
_simple
*
st_sysfs_class
;
static
struct
class
*
st_sysfs_class
;
MODULE_AUTHOR
(
"Kai Makisara"
);
MODULE_DESCRIPTION
(
"SCSI Tape Driver"
);
...
...
@@ -4024,8 +4024,9 @@ static int st_probe(struct device *dev)
if
(
STm
->
cdevs
[
j
])
{
if
(
cdev
==
STm
->
cdevs
[
j
])
cdev
=
NULL
;
class_simple_device_remove
(
MKDEV
(
SCSI_TAPE_MAJOR
,
TAPE_MINOR
(
i
,
mode
,
j
)));
class_device_destroy
(
st_sysfs_class
,
MKDEV
(
SCSI_TAPE_MAJOR
,
TAPE_MINOR
(
i
,
mode
,
j
)));
cdev_del
(
STm
->
cdevs
[
j
]);
}
}
...
...
@@ -4068,8 +4069,9 @@ static int st_remove(struct device *dev)
devfs_remove
(
"%s/mt%s"
,
SDp
->
devfs_name
,
st_formats
[
j
]);
devfs_remove
(
"%s/mt%sn"
,
SDp
->
devfs_name
,
st_formats
[
j
]);
for
(
j
=
0
;
j
<
2
;
j
++
)
{
class_simple_device_remove
(
MKDEV
(
SCSI_TAPE_MAJOR
,
TAPE_MINOR
(
i
,
mode
,
j
)));
class_device_destroy
(
st_sysfs_class
,
MKDEV
(
SCSI_TAPE_MAJOR
,
TAPE_MINOR
(
i
,
mode
,
j
)));
cdev_del
(
tpnt
->
modes
[
mode
].
cdevs
[
j
]);
tpnt
->
modes
[
mode
].
cdevs
[
j
]
=
NULL
;
}
...
...
@@ -4134,7 +4136,7 @@ static int __init init_st(void)
"st: Version %s, fixed bufsize %d, s/g segs %d
\n
"
,
verstr
,
st_fixed_buffer_size
,
st_max_sg_segs
);
st_sysfs_class
=
class_
simple_
create
(
THIS_MODULE
,
"scsi_tape"
);
st_sysfs_class
=
class_create
(
THIS_MODULE
,
"scsi_tape"
);
if
(
IS_ERR
(
st_sysfs_class
))
{
st_sysfs_class
=
NULL
;
printk
(
KERN_ERR
"Unable create sysfs class for SCSI tapes
\n
"
);
...
...
@@ -4148,7 +4150,7 @@ static int __init init_st(void)
return
0
;
}
if
(
st_sysfs_class
)
class_
simple_destroy
(
st_sysfs_class
);
class_
destroy
(
st_sysfs_class
);
unregister_chrdev_region
(
MKDEV
(
SCSI_TAPE_MAJOR
,
0
),
ST_MAX_TAPE_ENTRIES
);
...
...
@@ -4161,7 +4163,7 @@ static int __init init_st(void)
static
void
__exit
exit_st
(
void
)
{
if
(
st_sysfs_class
)
class_
simple_
destroy
(
st_sysfs_class
);
class_destroy
(
st_sysfs_class
);
st_sysfs_class
=
NULL
;
do_remove_driverfs_files
();
scsi_unregister_driver
(
&
st_template
.
gendrv
);
...
...
@@ -4284,12 +4286,12 @@ static void do_create_class_files(struct scsi_tape *STp, int dev_num, int mode)
snprintf
(
name
,
10
,
"%s%s%s"
,
rew
?
"n"
:
""
,
STp
->
disk
->
disk_name
,
st_formats
[
i
]);
st_class_member
=
class_
simple_device_add
(
st_sysfs_class
,
MKDEV
(
SCSI_TAPE_MAJOR
,
TAPE_MINOR
(
dev_num
,
mode
,
rew
)),
&
STp
->
device
->
sdev_gendev
,
"%s"
,
name
);
class_
device_create
(
st_sysfs_class
,
MKDEV
(
SCSI_TAPE_MAJOR
,
TAPE_MINOR
(
dev_num
,
mode
,
rew
)),
&
STp
->
device
->
sdev_gendev
,
"%s"
,
name
);
if
(
IS_ERR
(
st_class_member
))
{
printk
(
KERN_WARNING
"st%d: class_
simple_device_add
failed
\n
"
,
printk
(
KERN_WARNING
"st%d: class_
device_create
failed
\n
"
,
dev_num
);
goto
out
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录