Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
29b59417
Commit
29b59417
authored
Dec 16, 2008
by
Mauro Carvalho Chehab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V4L/DVB (9910): em28xx: move res_get locks to the caller routines
Signed-off-by:
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
parent
7831364f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
11 deletions
+25
-11
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/em28xx/em28xx-video.c
+25
-11
No files found.
drivers/media/video/em28xx/em28xx-video.c
View file @
29b59417
...
...
@@ -599,12 +599,10 @@ static int res_get(struct em28xx_fh *fh)
return
rc
;
if
(
dev
->
stream_on
)
return
-
E
INVAL
;
return
-
E
BUSY
;
mutex_lock
(
&
dev
->
lock
);
dev
->
stream_on
=
1
;
fh
->
stream_on
=
1
;
mutex_unlock
(
&
dev
->
lock
);
return
rc
;
}
...
...
@@ -1257,8 +1255,12 @@ static int vidioc_streamon(struct file *file, void *priv,
return
rc
;
if
(
unlikely
(
res_get
(
fh
)
<
0
))
return
-
EBUSY
;
mutex_lock
(
&
dev
->
lock
);
rc
=
res_get
(
fh
);
mutex_unlock
(
&
dev
->
lock
);
if
(
unlikely
(
rc
<
0
))
return
rc
;
return
(
videobuf_streamon
(
&
fh
->
vb_vidq
));
}
...
...
@@ -1738,8 +1740,12 @@ em28xx_v4l2_read(struct file *filp, char __user *buf, size_t count,
*/
if
(
fh
->
type
==
V4L2_BUF_TYPE_VIDEO_CAPTURE
)
{
if
(
unlikely
(
res_get
(
fh
)))
return
-
EBUSY
;
mutex_lock
(
&
dev
->
lock
);
rc
=
res_get
(
fh
);
mutex_unlock
(
&
dev
->
lock
);
if
(
unlikely
(
rc
<
0
))
return
rc
;
return
videobuf_read_stream
(
&
fh
->
vb_vidq
,
buf
,
count
,
pos
,
0
,
filp
->
f_flags
&
O_NONBLOCK
);
...
...
@@ -1761,7 +1767,11 @@ static unsigned int em28xx_v4l2_poll(struct file *filp, poll_table * wait)
if
(
rc
<
0
)
return
rc
;
if
(
unlikely
(
res_get
(
fh
)
<
0
))
mutex_lock
(
&
dev
->
lock
);
rc
=
res_get
(
fh
);
mutex_unlock
(
&
dev
->
lock
);
if
(
unlikely
(
rc
<
0
))
return
POLLERR
;
if
(
V4L2_BUF_TYPE_VIDEO_CAPTURE
!=
fh
->
type
)
...
...
@@ -1779,13 +1789,17 @@ static int em28xx_v4l2_mmap(struct file *filp, struct vm_area_struct *vma)
struct
em28xx
*
dev
=
fh
->
dev
;
int
rc
;
if
(
unlikely
(
res_get
(
fh
)
<
0
))
return
-
EBUSY
;
rc
=
check_dev
(
dev
);
if
(
rc
<
0
)
return
rc
;
mutex_lock
(
&
dev
->
lock
);
rc
=
res_get
(
fh
);
mutex_unlock
(
&
dev
->
lock
);
if
(
unlikely
(
rc
<
0
))
return
rc
;
rc
=
videobuf_mmap_mapper
(
&
fh
->
vb_vidq
,
vma
);
em28xx_videodbg
(
"vma start=0x%08lx, size=%ld, ret=%d
\n
"
,
...
...
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