Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
5099d234
K
Kernel
项目概览
openeuler
/
Kernel
接近 2 年 前同步成功
通知
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看板
提交
5099d234
编写于
9月 11, 2018
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
serial_core: switch to ->[sg]et_serial()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
6da5b587
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
26 deletion
+12
-26
drivers/tty/serial/serial_core.c
drivers/tty/serial/serial_core.c
+12
-26
未找到文件。
drivers/tty/serial/serial_core.c
浏览文件 @
5099d234
...
@@ -778,17 +778,13 @@ static int uart_get_info(struct tty_port *port, struct serial_struct *retinfo)
...
@@ -778,17 +778,13 @@ static int uart_get_info(struct tty_port *port, struct serial_struct *retinfo)
return
ret
;
return
ret
;
}
}
static
int
uart_get_info_user
(
struct
tty_
port
*
port
,
static
int
uart_get_info_user
(
struct
tty_
struct
*
tty
,
struct
serial_struct
__user
*
retinfo
)
struct
serial_struct
*
ss
)
{
{
struct
serial_struct
tmp
;
struct
uart_state
*
state
=
tty
->
driver_data
;
struct
tty_port
*
port
=
&
state
->
port
;
if
(
uart_get_info
(
port
,
&
tmp
)
<
0
)
return
-
EIO
;
if
(
copy_to_user
(
retinfo
,
&
tmp
,
sizeof
(
*
retinfo
)))
return
uart_get_info
(
port
,
ss
)
<
0
?
-
EIO
:
0
;
return
-
EFAULT
;
return
0
;
}
}
static
int
uart_set_info
(
struct
tty_struct
*
tty
,
struct
tty_port
*
port
,
static
int
uart_set_info
(
struct
tty_struct
*
tty
,
struct
tty_port
*
port
,
...
@@ -990,16 +986,13 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port,
...
@@ -990,16 +986,13 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port,
return
retval
;
return
retval
;
}
}
static
int
uart_set_info_user
(
struct
tty_struct
*
tty
,
struct
uart_state
*
state
,
static
int
uart_set_info_user
(
struct
tty_struct
*
tty
,
struct
serial_struct
*
ss
)
struct
serial_struct
__user
*
newinfo
)
{
{
struct
serial_struct
new_serial
;
struct
uart_state
*
state
=
tty
->
driver_data
;
struct
tty_port
*
port
=
&
state
->
port
;
struct
tty_port
*
port
=
&
state
->
port
;
int
retval
;
int
retval
;
if
(
copy_from_user
(
&
new_serial
,
newinfo
,
sizeof
(
new_serial
)))
down_write
(
&
tty
->
termios_rwsem
);
return
-
EFAULT
;
/*
/*
* This semaphore protects port->count. It is also
* This semaphore protects port->count. It is also
* very useful to prevent opens. Also, take the
* very useful to prevent opens. Also, take the
...
@@ -1008,8 +1001,9 @@ static int uart_set_info_user(struct tty_struct *tty, struct uart_state *state,
...
@@ -1008,8 +1001,9 @@ static int uart_set_info_user(struct tty_struct *tty, struct uart_state *state,
* under us.
* under us.
*/
*/
mutex_lock
(
&
port
->
mutex
);
mutex_lock
(
&
port
->
mutex
);
retval
=
uart_set_info
(
tty
,
port
,
state
,
&
new_serial
);
retval
=
uart_set_info
(
tty
,
port
,
state
,
ss
);
mutex_unlock
(
&
port
->
mutex
);
mutex_unlock
(
&
port
->
mutex
);
up_write
(
&
tty
->
termios_rwsem
);
return
retval
;
return
retval
;
}
}
...
@@ -1325,16 +1319,6 @@ uart_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
...
@@ -1325,16 +1319,6 @@ uart_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
* These ioctls don't rely on the hardware to be present.
* These ioctls don't rely on the hardware to be present.
*/
*/
switch
(
cmd
)
{
switch
(
cmd
)
{
case
TIOCGSERIAL
:
ret
=
uart_get_info_user
(
port
,
uarg
);
break
;
case
TIOCSSERIAL
:
down_write
(
&
tty
->
termios_rwsem
);
ret
=
uart_set_info_user
(
tty
,
state
,
uarg
);
up_write
(
&
tty
->
termios_rwsem
);
break
;
case
TIOCSERCONFIG
:
case
TIOCSERCONFIG
:
down_write
(
&
tty
->
termios_rwsem
);
down_write
(
&
tty
->
termios_rwsem
);
ret
=
uart_do_autoconfig
(
tty
,
state
);
ret
=
uart_do_autoconfig
(
tty
,
state
);
...
@@ -2413,6 +2397,8 @@ static const struct tty_operations uart_ops = {
...
@@ -2413,6 +2397,8 @@ static const struct tty_operations uart_ops = {
#endif
#endif
.
tiocmget
=
uart_tiocmget
,
.
tiocmget
=
uart_tiocmget
,
.
tiocmset
=
uart_tiocmset
,
.
tiocmset
=
uart_tiocmset
,
.
set_serial
=
uart_set_info_user
,
.
get_serial
=
uart_get_info_user
,
.
get_icount
=
uart_get_icount
,
.
get_icount
=
uart_get_icount
,
#ifdef CONFIG_CONSOLE_POLL
#ifdef CONFIG_CONSOLE_POLL
.
poll_init
=
uart_poll_init
,
.
poll_init
=
uart_poll_init
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录