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
79ff50c0
Commit
79ff50c0
authored
Apr 03, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serial2002: switch to __vfs_read/__vfs_write
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
e1452866
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
drivers/staging/comedi/drivers/serial2002.c
drivers/staging/comedi/drivers/serial2002.c
+6
-12
No files found.
drivers/staging/comedi/drivers/serial2002.c
View file @
79ff50c0
...
@@ -110,24 +110,16 @@ static int serial2002_tty_write(struct file *f, unsigned char *buf, int count)
...
@@ -110,24 +110,16 @@ static int serial2002_tty_write(struct file *f, unsigned char *buf, int count)
{
{
const
char
__user
*
p
=
(
__force
const
char
__user
*
)
buf
;
const
char
__user
*
p
=
(
__force
const
char
__user
*
)
buf
;
int
result
;
int
result
;
loff_t
offset
=
0
;
mm_segment_t
oldfs
;
mm_segment_t
oldfs
;
oldfs
=
get_fs
();
oldfs
=
get_fs
();
set_fs
(
KERNEL_DS
);
set_fs
(
KERNEL_DS
);
f
->
f_pos
=
0
;
result
=
__vfs_write
(
f
,
p
,
count
,
&
offset
);
result
=
f
->
f_op
->
write
(
f
,
p
,
count
,
&
f
->
f_pos
);
set_fs
(
oldfs
);
set_fs
(
oldfs
);
return
result
;
return
result
;
}
}
static
int
serial2002_tty_readb
(
struct
file
*
f
,
unsigned
char
*
buf
)
{
char
__user
*
p
=
(
__force
char
__user
*
)
buf
;
f
->
f_pos
=
0
;
return
f
->
f_op
->
read
(
f
,
p
,
1
,
&
f
->
f_pos
);
}
static
void
serial2002_tty_read_poll_wait
(
struct
file
*
f
,
int
timeout
)
static
void
serial2002_tty_read_poll_wait
(
struct
file
*
f
,
int
timeout
)
{
{
struct
poll_wqueues
table
;
struct
poll_wqueues
table
;
...
@@ -163,13 +155,15 @@ static int serial2002_tty_read(struct file *f, int timeout)
...
@@ -163,13 +155,15 @@ static int serial2002_tty_read(struct file *f, int timeout)
result
=
-
1
;
result
=
-
1
;
if
(
!
IS_ERR
(
f
))
{
if
(
!
IS_ERR
(
f
))
{
mm_segment_t
oldfs
;
mm_segment_t
oldfs
;
char
__user
*
p
=
(
__force
char
__user
*
)
&
ch
;
loff_t
offset
=
0
;
oldfs
=
get_fs
();
oldfs
=
get_fs
();
set_fs
(
KERNEL_DS
);
set_fs
(
KERNEL_DS
);
if
(
f
->
f_op
->
poll
)
{
if
(
f
->
f_op
->
poll
)
{
serial2002_tty_read_poll_wait
(
f
,
timeout
);
serial2002_tty_read_poll_wait
(
f
,
timeout
);
if
(
serial2002_tty_readb
(
f
,
&
ch
)
==
1
)
if
(
__vfs_read
(
f
,
p
,
1
,
&
offset
)
==
1
)
result
=
ch
;
result
=
ch
;
}
else
{
}
else
{
/* Device does not support poll, busy wait */
/* Device does not support poll, busy wait */
...
@@ -180,7 +174,7 @@ static int serial2002_tty_read(struct file *f, int timeout)
...
@@ -180,7 +174,7 @@ static int serial2002_tty_read(struct file *f, int timeout)
if
(
retries
>=
timeout
)
if
(
retries
>=
timeout
)
break
;
break
;
if
(
serial2002_tty_readb
(
f
,
&
ch
)
==
1
)
{
if
(
__vfs_read
(
f
,
p
,
1
,
&
offset
)
==
1
)
{
result
=
ch
;
result
=
ch
;
break
;
break
;
}
}
...
...
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