Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
56b22935
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
56b22935
编写于
3月 23, 2005
作者:
G
gregkh@suse.de
提交者:
Greg Kroah-Hartman
6月 20, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] class: convert drivers/* to use the new class api instead of class_simple
Signed-off-by:
N
Greg Kroah-Hartman
<
gregkh@suse.de
>
上级
8874b414
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
51 addition
and
53 deletion
+51
-53
drivers/isdn/capi/capi.c
drivers/isdn/capi/capi.c
+7
-7
drivers/macintosh/adb.c
drivers/macintosh/adb.c
+4
-5
drivers/media/dvb/dvb-core/dvbdev.c
drivers/media/dvb/dvb-core/dvbdev.c
+6
-7
drivers/net/ppp_generic.c
drivers/net/ppp_generic.c
+7
-7
drivers/net/wan/cosa.c
drivers/net/wan/cosa.c
+6
-6
drivers/s390/char/tape_class.c
drivers/s390/char/tape_class.c
+5
-5
drivers/s390/char/vmlogrdr.c
drivers/s390/char/vmlogrdr.c
+5
-5
drivers/usb/core/file.c
drivers/usb/core/file.c
+6
-6
drivers/video/fbmem.c
drivers/video/fbmem.c
+5
-5
未找到文件。
drivers/isdn/capi/capi.c
浏览文件 @
56b22935
...
...
@@ -58,7 +58,7 @@ MODULE_LICENSE("GPL");
/* -------- driver information -------------------------------------- */
static
struct
class
_simple
*
capi_class
;
static
struct
class
*
capi_class
;
static
int
capi_major
=
68
;
/* allocated */
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
...
...
@@ -1499,20 +1499,20 @@ static int __init capi_init(void)
return
-
EIO
;
}
capi_class
=
class_
simple_
create
(
THIS_MODULE
,
"capi"
);
capi_class
=
class_create
(
THIS_MODULE
,
"capi"
);
if
(
IS_ERR
(
capi_class
))
{
unregister_chrdev
(
capi_major
,
"capi20"
);
return
PTR_ERR
(
capi_class
);
}
class_
simple_device_add
(
capi_class
,
MKDEV
(
capi_major
,
0
),
NULL
,
"capi"
);
class_
device_create
(
capi_class
,
MKDEV
(
capi_major
,
0
),
NULL
,
"capi"
);
devfs_mk_cdev
(
MKDEV
(
capi_major
,
0
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"isdn/capi20"
);
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
if
(
capinc_tty_init
()
<
0
)
{
class_
simple_device_remove
(
MKDEV
(
capi_major
,
0
));
class_
simple_
destroy
(
capi_class
);
class_
device_destroy
(
capi_class
,
MKDEV
(
capi_major
,
0
));
class_destroy
(
capi_class
);
unregister_chrdev
(
capi_major
,
"capi20"
);
return
-
ENOMEM
;
}
...
...
@@ -1539,8 +1539,8 @@ static void __exit capi_exit(void)
{
proc_exit
();
class_
simple_device_remove
(
MKDEV
(
capi_major
,
0
));
class_
simple_
destroy
(
capi_class
);
class_
device_destroy
(
capi_class
,
MKDEV
(
capi_major
,
0
));
class_destroy
(
capi_class
);
unregister_chrdev
(
capi_major
,
"capi20"
);
devfs_remove
(
"isdn/capi20"
);
...
...
drivers/macintosh/adb.c
浏览文件 @
56b22935
...
...
@@ -77,7 +77,7 @@ static struct adb_driver *adb_driver_list[] = {
NULL
};
static
struct
class
_simple
*
adb_dev_class
;
static
struct
class
*
adb_dev_class
;
struct
adb_driver
*
adb_controller
;
struct
notifier_block
*
adb_client_list
=
NULL
;
...
...
@@ -902,9 +902,8 @@ adbdev_init(void)
devfs_mk_cdev
(
MKDEV
(
ADB_MAJOR
,
0
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"adb"
);
adb_dev_class
=
class_
simple_
create
(
THIS_MODULE
,
"adb"
);
if
(
IS_ERR
(
adb_dev_class
))
{
adb_dev_class
=
class_create
(
THIS_MODULE
,
"adb"
);
if
(
IS_ERR
(
adb_dev_class
))
return
;
}
class_simple_device_add
(
adb_dev_class
,
MKDEV
(
ADB_MAJOR
,
0
),
NULL
,
"adb"
);
class_device_create
(
adb_dev_class
,
MKDEV
(
ADB_MAJOR
,
0
),
NULL
,
"adb"
);
}
drivers/media/dvb/dvb-core/dvbdev.c
浏览文件 @
56b22935
...
...
@@ -56,8 +56,7 @@ static const char * const dnames[] = {
#define nums2minor(num,type,id) ((num << 6) | (id << 4) | type)
#define MAX_DVB_MINORS (DVB_MAX_ADAPTERS*64)
struct
class_simple
*
dvb_class
;
EXPORT_SYMBOL
(
dvb_class
);
static
struct
class
*
dvb_class
;
static
struct
dvb_device
*
dvbdev_find_device
(
int
minor
)
{
...
...
@@ -236,8 +235,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"dvb/adapter%d/%s%d"
,
adap
->
num
,
dnames
[
type
],
id
);
class_
simple_device_add
(
dvb_class
,
MKDEV
(
DVB_MAJOR
,
nums2minor
(
adap
->
num
,
type
,
id
)),
NULL
,
"dvb%d.%s%d"
,
adap
->
num
,
dnames
[
type
],
id
);
class_
device_create
(
dvb_class
,
MKDEV
(
DVB_MAJOR
,
nums2minor
(
adap
->
num
,
type
,
id
)),
NULL
,
"dvb%d.%s%d"
,
adap
->
num
,
dnames
[
type
],
id
);
dprintk
(
"DVB: register adapter%d/%s%d @ minor: %i (0x%02x)
\n
"
,
adap
->
num
,
dnames
[
type
],
id
,
nums2minor
(
adap
->
num
,
type
,
id
),
...
...
@@ -256,7 +255,7 @@ void dvb_unregister_device(struct dvb_device *dvbdev)
devfs_remove
(
"dvb/adapter%d/%s%d"
,
dvbdev
->
adapter
->
num
,
dnames
[
dvbdev
->
type
],
dvbdev
->
id
);
class_
simple_device_remove
(
MKDEV
(
DVB_MAJOR
,
nums2minor
(
dvbdev
->
adapter
->
num
,
class_
device_destroy
(
dvb_class
,
MKDEV
(
DVB_MAJOR
,
nums2minor
(
dvbdev
->
adapter
->
num
,
dvbdev
->
type
,
dvbdev
->
id
)));
list_del
(
&
dvbdev
->
list_head
);
...
...
@@ -412,7 +411,7 @@ static int __init init_dvbdev(void)
devfs_mk_dir
(
"dvb"
);
dvb_class
=
class_
simple_
create
(
THIS_MODULE
,
"dvb"
);
dvb_class
=
class_create
(
THIS_MODULE
,
"dvb"
);
if
(
IS_ERR
(
dvb_class
))
{
retval
=
PTR_ERR
(
dvb_class
);
goto
error
;
...
...
@@ -429,7 +428,7 @@ static int __init init_dvbdev(void)
static
void
__exit
exit_dvbdev
(
void
)
{
devfs_remove
(
"dvb"
);
class_
simple_
destroy
(
dvb_class
);
class_destroy
(
dvb_class
);
cdev_del
(
&
dvb_device_cdev
);
unregister_chrdev_region
(
MKDEV
(
DVB_MAJOR
,
0
),
MAX_DVB_MINORS
);
}
...
...
drivers/net/ppp_generic.c
浏览文件 @
56b22935
...
...
@@ -273,7 +273,7 @@ static int ppp_connect_channel(struct channel *pch, int unit);
static
int
ppp_disconnect_channel
(
struct
channel
*
pch
);
static
void
ppp_destroy_channel
(
struct
channel
*
pch
);
static
struct
class
_simple
*
ppp_class
;
static
struct
class
*
ppp_class
;
/* Translates a PPP protocol number to a NP index (NP == network protocol) */
static
inline
int
proto_to_npindex
(
int
proto
)
...
...
@@ -858,12 +858,12 @@ static int __init ppp_init(void)
printk
(
KERN_INFO
"PPP generic driver version "
PPP_VERSION
"
\n
"
);
err
=
register_chrdev
(
PPP_MAJOR
,
"ppp"
,
&
ppp_device_fops
);
if
(
!
err
)
{
ppp_class
=
class_
simple_
create
(
THIS_MODULE
,
"ppp"
);
ppp_class
=
class_create
(
THIS_MODULE
,
"ppp"
);
if
(
IS_ERR
(
ppp_class
))
{
err
=
PTR_ERR
(
ppp_class
);
goto
out_chrdev
;
}
class_
simple_device_add
(
ppp_class
,
MKDEV
(
PPP_MAJOR
,
0
),
NULL
,
"ppp"
);
class_
device_create
(
ppp_class
,
MKDEV
(
PPP_MAJOR
,
0
),
NULL
,
"ppp"
);
err
=
devfs_mk_cdev
(
MKDEV
(
PPP_MAJOR
,
0
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"ppp"
);
if
(
err
)
...
...
@@ -876,8 +876,8 @@ static int __init ppp_init(void)
return
err
;
out_class:
class_
simple_device_remove
(
MKDEV
(
PPP_MAJOR
,
0
));
class_
simple_
destroy
(
ppp_class
);
class_
device_destroy
(
ppp_class
,
MKDEV
(
PPP_MAJOR
,
0
));
class_destroy
(
ppp_class
);
out_chrdev:
unregister_chrdev
(
PPP_MAJOR
,
"ppp"
);
goto
out
;
...
...
@@ -2654,8 +2654,8 @@ static void __exit ppp_cleanup(void)
if
(
unregister_chrdev
(
PPP_MAJOR
,
"ppp"
)
!=
0
)
printk
(
KERN_ERR
"PPP: failed to unregister PPP device
\n
"
);
devfs_remove
(
"ppp"
);
class_
simple_device_remove
(
MKDEV
(
PPP_MAJOR
,
0
));
class_
simple_
destroy
(
ppp_class
);
class_
device_destroy
(
ppp_class
,
MKDEV
(
PPP_MAJOR
,
0
));
class_destroy
(
ppp_class
);
}
/*
...
...
drivers/net/wan/cosa.c
浏览文件 @
56b22935
...
...
@@ -235,7 +235,7 @@ static int dma[MAX_CARDS+1];
static
int
irq
[
MAX_CARDS
+
1
]
=
{
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
0
,
};
/* for class stuff*/
static
struct
class
_simple
*
cosa_class
;
static
struct
class
*
cosa_class
;
#ifdef MODULE
module_param_array
(
io
,
int
,
NULL
,
0
);
...
...
@@ -394,19 +394,19 @@ static int __init cosa_init(void)
goto
out
;
}
devfs_mk_dir
(
"cosa"
);
cosa_class
=
class_
simple_
create
(
THIS_MODULE
,
"cosa"
);
cosa_class
=
class_create
(
THIS_MODULE
,
"cosa"
);
if
(
IS_ERR
(
cosa_class
))
{
err
=
PTR_ERR
(
cosa_class
);
goto
out_chrdev
;
}
for
(
i
=
0
;
i
<
nr_cards
;
i
++
)
{
class_
simple_device_add
(
cosa_class
,
MKDEV
(
cosa_major
,
i
),
class_
device_create
(
cosa_class
,
MKDEV
(
cosa_major
,
i
),
NULL
,
"cosa%d"
,
i
);
err
=
devfs_mk_cdev
(
MKDEV
(
cosa_major
,
i
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"cosa/%d"
,
i
);
if
(
err
)
{
class_
simple_device_remove
(
MKDEV
(
cosa_major
,
i
));
class_
device_destroy
(
cosa_class
,
MKDEV
(
cosa_major
,
i
));
goto
out_chrdev
;
}
}
...
...
@@ -427,10 +427,10 @@ static void __exit cosa_exit(void)
printk
(
KERN_INFO
"Unloading the cosa module
\n
"
);
for
(
i
=
0
;
i
<
nr_cards
;
i
++
)
{
class_
simple_device_remove
(
MKDEV
(
cosa_major
,
i
));
class_
device_destroy
(
cosa_class
,
MKDEV
(
cosa_major
,
i
));
devfs_remove
(
"cosa/%d"
,
i
);
}
class_
simple_
destroy
(
cosa_class
);
class_destroy
(
cosa_class
);
devfs_remove
(
"cosa"
);
for
(
cosa
=
cosa_cards
;
nr_cards
--
;
cosa
++
)
{
/* Clean up the per-channel data */
...
...
drivers/s390/char/tape_class.c
浏览文件 @
56b22935
...
...
@@ -16,7 +16,7 @@ MODULE_DESCRIPTION(
);
MODULE_LICENSE
(
"GPL"
);
st
ruct
class_simple
*
tape_class
;
st
atic
struct
class
*
tape_class
;
/*
* Register a tape device and return a pointer to the cdev structure.
...
...
@@ -70,7 +70,7 @@ struct tape_class_device *register_tape_dev(
if
(
rc
)
goto
fail_with_cdev
;
tcd
->
class_device
=
class_
simple_device_add
(
tcd
->
class_device
=
class_
device_create
(
tape_class
,
tcd
->
char_device
->
dev
,
device
,
...
...
@@ -101,7 +101,7 @@ void unregister_tape_dev(struct tape_class_device *tcd)
&
tcd
->
class_device
->
dev
->
kobj
,
tcd
->
mode_name
);
class_
simple_device_remove
(
tcd
->
char_device
->
dev
);
class_
device_destroy
(
tape_class
,
tcd
->
char_device
->
dev
);
cdev_del
(
tcd
->
char_device
);
kfree
(
tcd
);
}
...
...
@@ -111,14 +111,14 @@ EXPORT_SYMBOL(unregister_tape_dev);
static
int
__init
tape_init
(
void
)
{
tape_class
=
class_
simple_
create
(
THIS_MODULE
,
"tape390"
);
tape_class
=
class_create
(
THIS_MODULE
,
"tape390"
);
return
0
;
}
static
void
__exit
tape_exit
(
void
)
{
class_
simple_
destroy
(
tape_class
);
class_destroy
(
tape_class
);
tape_class
=
NULL
;
}
...
...
drivers/s390/char/vmlogrdr.c
浏览文件 @
56b22935
...
...
@@ -703,7 +703,7 @@ static struct attribute_group vmlogrdr_attr_group = {
.
attrs
=
vmlogrdr_attrs
,
};
static
struct
class
_simple
*
vmlogrdr_class
;
static
struct
class
*
vmlogrdr_class
;
static
struct
device_driver
vmlogrdr_driver
=
{
.
name
=
"vmlogrdr"
,
.
bus
=
&
iucv_bus
,
...
...
@@ -727,7 +727,7 @@ vmlogrdr_register_driver(void) {
goto
unregdriver
;
}
vmlogrdr_class
=
class_
simple_
create
(
THIS_MODULE
,
"vmlogrdr"
);
vmlogrdr_class
=
class_create
(
THIS_MODULE
,
"vmlogrdr"
);
if
(
IS_ERR
(
vmlogrdr_class
))
{
printk
(
KERN_ERR
"vmlogrdr: failed to create class.
\n
"
);
ret
=
PTR_ERR
(
vmlogrdr_class
);
...
...
@@ -746,7 +746,7 @@ vmlogrdr_register_driver(void) {
static
void
vmlogrdr_unregister_driver
(
void
)
{
class_
simple_
destroy
(
vmlogrdr_class
);
class_destroy
(
vmlogrdr_class
);
vmlogrdr_class
=
NULL
;
driver_remove_file
(
&
vmlogrdr_driver
,
&
driver_attr_recording_status
);
driver_unregister
(
&
vmlogrdr_driver
);
...
...
@@ -786,7 +786,7 @@ vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) {
device_unregister
(
dev
);
return
ret
;
}
priv
->
class_device
=
class_
simple_device_add
(
priv
->
class_device
=
class_
device_create
(
vmlogrdr_class
,
MKDEV
(
vmlogrdr_major
,
priv
->
minor_num
),
dev
,
...
...
@@ -806,7 +806,7 @@ vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) {
static
int
vmlogrdr_unregister_device
(
struct
vmlogrdr_priv_t
*
priv
)
{
class_
simple_device_remove
(
MKDEV
(
vmlogrdr_major
,
priv
->
minor_num
));
class_
device_destroy
(
vmlogrdr_class
,
MKDEV
(
vmlogrdr_major
,
priv
->
minor_num
));
if
(
priv
->
device
!=
NULL
)
{
sysfs_remove_group
(
&
priv
->
device
->
kobj
,
&
vmlogrdr_attr_group
);
device_unregister
(
priv
->
device
);
...
...
drivers/usb/core/file.c
浏览文件 @
56b22935
...
...
@@ -68,7 +68,7 @@ static struct file_operations usb_fops = {
.
open
=
usb_open
,
};
static
struct
class
_simple
*
usb_class
;
static
struct
class
*
usb_class
;
int
usb_major_init
(
void
)
{
...
...
@@ -80,9 +80,9 @@ int usb_major_init(void)
goto
out
;
}
usb_class
=
class_
simple_
create
(
THIS_MODULE
,
"usb"
);
usb_class
=
class_create
(
THIS_MODULE
,
"usb"
);
if
(
IS_ERR
(
usb_class
))
{
err
(
"class_
simple_
create failed for usb devices"
);
err
(
"class_create failed for usb devices"
);
unregister_chrdev
(
USB_MAJOR
,
"usb"
);
goto
out
;
}
...
...
@@ -95,7 +95,7 @@ int usb_major_init(void)
void
usb_major_cleanup
(
void
)
{
class_
simple_
destroy
(
usb_class
);
class_destroy
(
usb_class
);
devfs_remove
(
"usb"
);
unregister_chrdev
(
USB_MAJOR
,
"usb"
);
}
...
...
@@ -171,7 +171,7 @@ int usb_register_dev(struct usb_interface *intf,
++
temp
;
else
temp
=
name
;
intf
->
class_dev
=
class_
simple_device_add
(
usb_class
,
MKDEV
(
USB_MAJOR
,
minor
),
&
intf
->
dev
,
"%s"
,
temp
);
intf
->
class_dev
=
class_
device_create
(
usb_class
,
MKDEV
(
USB_MAJOR
,
minor
),
&
intf
->
dev
,
"%s"
,
temp
);
if
(
IS_ERR
(
intf
->
class_dev
))
{
spin_lock
(
&
minor_lock
);
usb_minors
[
intf
->
minor
]
=
NULL
;
...
...
@@ -220,7 +220,7 @@ void usb_deregister_dev(struct usb_interface *intf,
snprintf
(
name
,
BUS_ID_SIZE
,
class_driver
->
name
,
intf
->
minor
-
minor_base
);
devfs_remove
(
name
);
class_
simple_device_remove
(
MKDEV
(
USB_MAJOR
,
intf
->
minor
));
class_
device_destroy
(
usb_class
,
MKDEV
(
USB_MAJOR
,
intf
->
minor
));
intf
->
class_dev
=
NULL
;
intf
->
minor
=
-
1
;
}
...
...
drivers/video/fbmem.c
浏览文件 @
56b22935
...
...
@@ -1040,7 +1040,7 @@ static struct file_operations fb_fops = {
#endif
};
static
struct
class
_simple
*
fb_class
;
static
struct
class
*
fb_class
;
/**
* register_framebuffer - registers a frame buffer device
...
...
@@ -1066,7 +1066,7 @@ register_framebuffer(struct fb_info *fb_info)
break
;
fb_info
->
node
=
i
;
fb_info
->
class_device
=
class_
simple_device_add
(
fb_class
,
MKDEV
(
FB_MAJOR
,
i
),
fb_info
->
class_device
=
class_
device_create
(
fb_class
,
MKDEV
(
FB_MAJOR
,
i
),
fb_info
->
device
,
"fb%d"
,
i
);
if
(
IS_ERR
(
fb_info
->
class_device
))
{
/* Not fatal */
...
...
@@ -1134,7 +1134,7 @@ unregister_framebuffer(struct fb_info *fb_info)
registered_fb
[
i
]
=
NULL
;
num_registered_fb
--
;
fb_cleanup_class_device
(
fb_info
);
class_
simple_device_remove
(
MKDEV
(
FB_MAJOR
,
i
));
class_
device_destroy
(
fb_class
,
MKDEV
(
FB_MAJOR
,
i
));
return
0
;
}
...
...
@@ -1197,7 +1197,7 @@ fbmem_init(void)
if
(
register_chrdev
(
FB_MAJOR
,
"fb"
,
&
fb_fops
))
printk
(
"unable to get major %d for fb devs
\n
"
,
FB_MAJOR
);
fb_class
=
class_
simple_
create
(
THIS_MODULE
,
"graphics"
);
fb_class
=
class_create
(
THIS_MODULE
,
"graphics"
);
if
(
IS_ERR
(
fb_class
))
{
printk
(
KERN_WARNING
"Unable to create fb class; errno = %ld
\n
"
,
PTR_ERR
(
fb_class
));
fb_class
=
NULL
;
...
...
@@ -1210,7 +1210,7 @@ module_init(fbmem_init);
static
void
__exit
fbmem_exit
(
void
)
{
class_
simple_
destroy
(
fb_class
);
class_destroy
(
fb_class
);
}
module_exit
(
fbmem_exit
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录