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
nexedi
linux
Commits
e8d1d9de
Commit
e8d1d9de
authored
Oct 07, 2003
by
Michael Hunold
Committed by
Linus Torvalds
Oct 07, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] multiple device *read* opens support
- allow multiple read device opens
parent
38beb0c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
drivers/media/dvb/dvb-core/dvb_frontend.c
drivers/media/dvb/dvb-core/dvb_frontend.c
+1
-0
drivers/media/dvb/dvb-core/dvbdev.c
drivers/media/dvb/dvb-core/dvbdev.c
+9
-2
drivers/media/dvb/dvb-core/dvbdev.h
drivers/media/dvb/dvb-core/dvbdev.h
+7
-1
No files found.
drivers/media/dvb/dvb-core/dvb_frontend.c
View file @
e8d1d9de
...
@@ -870,6 +870,7 @@ dvb_register_frontend (int (*ioctl) (struct dvb_frontend *frontend,
...
@@ -870,6 +870,7 @@ dvb_register_frontend (int (*ioctl) (struct dvb_frontend *frontend,
static
const
struct
dvb_device
dvbdev_template
=
{
static
const
struct
dvb_device
dvbdev_template
=
{
.
users
=
~
0
,
.
users
=
~
0
,
.
writers
=
1
,
.
writers
=
1
,
.
readers
=
(
~
0
)
-
1
,
.
fops
=
&
dvb_frontend_fops
,
.
fops
=
&
dvb_frontend_fops
,
.
kernel_ioctl
=
dvb_frontend_ioctl
.
kernel_ioctl
=
dvb_frontend_ioctl
};
};
...
...
drivers/media/dvb/dvb-core/dvbdev.c
View file @
e8d1d9de
...
@@ -112,7 +112,11 @@ int dvb_generic_open(struct inode *inode, struct file *file)
...
@@ -112,7 +112,11 @@ int dvb_generic_open(struct inode *inode, struct file *file)
if
(
!
dvbdev
->
users
)
if
(
!
dvbdev
->
users
)
return
-
EBUSY
;
return
-
EBUSY
;
if
((
file
->
f_flags
&
O_ACCMODE
)
!=
O_RDONLY
)
{
if
((
file
->
f_flags
&
O_ACCMODE
)
==
O_RDONLY
)
{
if
(
!
dvbdev
->
readers
)
return
-
EBUSY
;
dvbdev
->
readers
--
;
}
else
{
if
(
!
dvbdev
->
writers
)
if
(
!
dvbdev
->
writers
)
return
-
EBUSY
;
return
-
EBUSY
;
dvbdev
->
writers
--
;
dvbdev
->
writers
--
;
...
@@ -130,8 +134,11 @@ int dvb_generic_release(struct inode *inode, struct file *file)
...
@@ -130,8 +134,11 @@ int dvb_generic_release(struct inode *inode, struct file *file)
if
(
!
dvbdev
)
if
(
!
dvbdev
)
return
-
ENODEV
;
return
-
ENODEV
;
if
((
file
->
f_flags
&
O_ACCMODE
)
!=
O_RDONLY
)
if
((
file
->
f_flags
&
O_ACCMODE
)
==
O_RDONLY
)
{
dvbdev
->
readers
++
;
}
else
{
dvbdev
->
writers
++
;
dvbdev
->
writers
++
;
}
dvbdev
->
users
++
;
dvbdev
->
users
++
;
return
0
;
return
0
;
...
...
drivers/media/dvb/dvb-core/dvbdev.h
View file @
e8d1d9de
...
@@ -55,12 +55,18 @@ struct dvb_adapter {
...
@@ -55,12 +55,18 @@ struct dvb_adapter {
struct
dvb_device
{
struct
dvb_device
{
struct
list_head
list_head
;
struct
list_head
list_head
;
struct
file_operations
*
fops
;
struct
file_operations
*
fops
;
struct
dvb_adapter
*
adapter
;
struct
dvb_adapter
*
adapter
;
int
type
;
int
type
;
u32
id
;
u32
id
;
int
users
;
/* in theory, 'users' can vanish now,
but I don't want to change too much now... */
int
readers
;
int
writers
;
int
writers
;
int
users
;
/* don't really need those !? -- FIXME: use video_usercopy */
/* don't really need those !? -- FIXME: use video_usercopy */
int
(
*
kernel_ioctl
)(
struct
inode
*
inode
,
struct
file
*
file
,
int
(
*
kernel_ioctl
)(
struct
inode
*
inode
,
struct
file
*
file
,
...
...
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