Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
5099d234
Commit
5099d234
authored
Sep 11, 2018
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serial_core: switch to ->[sg]et_serial()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
6da5b587
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
26 deletions
+12
-26
drivers/tty/serial/serial_core.c
drivers/tty/serial/serial_core.c
+12
-26
No files found.
drivers/tty/serial/serial_core.c
View file @
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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment