Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
7fe845d1
L
linux
项目概览
xiphi1978
/
linux
通知
2
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,发现更多精彩内容 >>
提交
7fe845d1
编写于
3月 15, 2005
作者:
G
gregkh@suse.de
提交者:
Greg Kroah-Hartman
6月 20, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] tty: move to use the new class code, instead of class_simple
Signed-off-by:
N
Greg Kroah-Hartman
<
gregkh@suse.de
>
上级
e9ba6365
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
8 deletion
+8
-8
drivers/char/tty_io.c
drivers/char/tty_io.c
+8
-8
未找到文件。
drivers/char/tty_io.c
浏览文件 @
7fe845d1
...
@@ -2654,7 +2654,7 @@ static void tty_default_put_char(struct tty_struct *tty, unsigned char ch)
...
@@ -2654,7 +2654,7 @@ static void tty_default_put_char(struct tty_struct *tty, unsigned char ch)
tty
->
driver
->
write
(
tty
,
&
ch
,
1
);
tty
->
driver
->
write
(
tty
,
&
ch
,
1
);
}
}
static
struct
class
_simple
*
tty_class
;
static
struct
class
*
tty_class
;
/**
/**
* tty_register_device - register a tty device
* tty_register_device - register a tty device
...
@@ -2687,7 +2687,7 @@ void tty_register_device(struct tty_driver *driver, unsigned index,
...
@@ -2687,7 +2687,7 @@ void tty_register_device(struct tty_driver *driver, unsigned index,
pty_line_name
(
driver
,
index
,
name
);
pty_line_name
(
driver
,
index
,
name
);
else
else
tty_line_name
(
driver
,
index
,
name
);
tty_line_name
(
driver
,
index
,
name
);
class_
simple_device_add
(
tty_class
,
dev
,
device
,
name
);
class_
device_create
(
tty_class
,
dev
,
device
,
name
);
}
}
/**
/**
...
@@ -2701,7 +2701,7 @@ void tty_register_device(struct tty_driver *driver, unsigned index,
...
@@ -2701,7 +2701,7 @@ void tty_register_device(struct tty_driver *driver, unsigned index,
void
tty_unregister_device
(
struct
tty_driver
*
driver
,
unsigned
index
)
void
tty_unregister_device
(
struct
tty_driver
*
driver
,
unsigned
index
)
{
{
devfs_remove
(
"%s%d"
,
driver
->
devfs_name
,
index
+
driver
->
name_base
);
devfs_remove
(
"%s%d"
,
driver
->
devfs_name
,
index
+
driver
->
name_base
);
class_
simple_device_remove
(
MKDEV
(
driver
->
major
,
driver
->
minor_start
)
+
index
);
class_
device_destroy
(
tty_class
,
MKDEV
(
driver
->
major
,
driver
->
minor_start
)
+
index
);
}
}
EXPORT_SYMBOL
(
tty_register_device
);
EXPORT_SYMBOL
(
tty_register_device
);
...
@@ -2918,7 +2918,7 @@ extern int vty_init(void);
...
@@ -2918,7 +2918,7 @@ extern int vty_init(void);
static
int
__init
tty_class_init
(
void
)
static
int
__init
tty_class_init
(
void
)
{
{
tty_class
=
class_
simple_
create
(
THIS_MODULE
,
"tty"
);
tty_class
=
class_create
(
THIS_MODULE
,
"tty"
);
if
(
IS_ERR
(
tty_class
))
if
(
IS_ERR
(
tty_class
))
return
PTR_ERR
(
tty_class
);
return
PTR_ERR
(
tty_class
);
return
0
;
return
0
;
...
@@ -2947,14 +2947,14 @@ static int __init tty_init(void)
...
@@ -2947,14 +2947,14 @@ static int __init tty_init(void)
register_chrdev_region
(
MKDEV
(
TTYAUX_MAJOR
,
0
),
1
,
"/dev/tty"
)
<
0
)
register_chrdev_region
(
MKDEV
(
TTYAUX_MAJOR
,
0
),
1
,
"/dev/tty"
)
<
0
)
panic
(
"Couldn't register /dev/tty driver
\n
"
);
panic
(
"Couldn't register /dev/tty driver
\n
"
);
devfs_mk_cdev
(
MKDEV
(
TTYAUX_MAJOR
,
0
),
S_IFCHR
|
S_IRUGO
|
S_IWUGO
,
"tty"
);
devfs_mk_cdev
(
MKDEV
(
TTYAUX_MAJOR
,
0
),
S_IFCHR
|
S_IRUGO
|
S_IWUGO
,
"tty"
);
class_
simple_device_add
(
tty_class
,
MKDEV
(
TTYAUX_MAJOR
,
0
),
NULL
,
"tty"
);
class_
device_create
(
tty_class
,
MKDEV
(
TTYAUX_MAJOR
,
0
),
NULL
,
"tty"
);
cdev_init
(
&
console_cdev
,
&
console_fops
);
cdev_init
(
&
console_cdev
,
&
console_fops
);
if
(
cdev_add
(
&
console_cdev
,
MKDEV
(
TTYAUX_MAJOR
,
1
),
1
)
||
if
(
cdev_add
(
&
console_cdev
,
MKDEV
(
TTYAUX_MAJOR
,
1
),
1
)
||
register_chrdev_region
(
MKDEV
(
TTYAUX_MAJOR
,
1
),
1
,
"/dev/console"
)
<
0
)
register_chrdev_region
(
MKDEV
(
TTYAUX_MAJOR
,
1
),
1
,
"/dev/console"
)
<
0
)
panic
(
"Couldn't register /dev/console driver
\n
"
);
panic
(
"Couldn't register /dev/console driver
\n
"
);
devfs_mk_cdev
(
MKDEV
(
TTYAUX_MAJOR
,
1
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"console"
);
devfs_mk_cdev
(
MKDEV
(
TTYAUX_MAJOR
,
1
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"console"
);
class_
simple_device_add
(
tty_class
,
MKDEV
(
TTYAUX_MAJOR
,
1
),
NULL
,
"console"
);
class_
device_create
(
tty_class
,
MKDEV
(
TTYAUX_MAJOR
,
1
),
NULL
,
"console"
);
#ifdef CONFIG_UNIX98_PTYS
#ifdef CONFIG_UNIX98_PTYS
cdev_init
(
&
ptmx_cdev
,
&
ptmx_fops
);
cdev_init
(
&
ptmx_cdev
,
&
ptmx_fops
);
...
@@ -2962,7 +2962,7 @@ static int __init tty_init(void)
...
@@ -2962,7 +2962,7 @@ static int __init tty_init(void)
register_chrdev_region
(
MKDEV
(
TTYAUX_MAJOR
,
2
),
1
,
"/dev/ptmx"
)
<
0
)
register_chrdev_region
(
MKDEV
(
TTYAUX_MAJOR
,
2
),
1
,
"/dev/ptmx"
)
<
0
)
panic
(
"Couldn't register /dev/ptmx driver
\n
"
);
panic
(
"Couldn't register /dev/ptmx driver
\n
"
);
devfs_mk_cdev
(
MKDEV
(
TTYAUX_MAJOR
,
2
),
S_IFCHR
|
S_IRUGO
|
S_IWUGO
,
"ptmx"
);
devfs_mk_cdev
(
MKDEV
(
TTYAUX_MAJOR
,
2
),
S_IFCHR
|
S_IRUGO
|
S_IWUGO
,
"ptmx"
);
class_
simple_device_add
(
tty_class
,
MKDEV
(
TTYAUX_MAJOR
,
2
),
NULL
,
"ptmx"
);
class_
device_create
(
tty_class
,
MKDEV
(
TTYAUX_MAJOR
,
2
),
NULL
,
"ptmx"
);
#endif
#endif
#ifdef CONFIG_VT
#ifdef CONFIG_VT
...
@@ -2971,7 +2971,7 @@ static int __init tty_init(void)
...
@@ -2971,7 +2971,7 @@ static int __init tty_init(void)
register_chrdev_region
(
MKDEV
(
TTY_MAJOR
,
0
),
1
,
"/dev/vc/0"
)
<
0
)
register_chrdev_region
(
MKDEV
(
TTY_MAJOR
,
0
),
1
,
"/dev/vc/0"
)
<
0
)
panic
(
"Couldn't register /dev/tty0 driver
\n
"
);
panic
(
"Couldn't register /dev/tty0 driver
\n
"
);
devfs_mk_cdev
(
MKDEV
(
TTY_MAJOR
,
0
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"vc/0"
);
devfs_mk_cdev
(
MKDEV
(
TTY_MAJOR
,
0
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"vc/0"
);
class_
simple_device_add
(
tty_class
,
MKDEV
(
TTY_MAJOR
,
0
),
NULL
,
"tty0"
);
class_
device_create
(
tty_class
,
MKDEV
(
TTY_MAJOR
,
0
),
NULL
,
"tty0"
);
vty_init
();
vty_init
();
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录