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
cdc053a0
Commit
cdc053a0
authored
Apr 20, 2003
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] devfs: dvb
parent
1c6099ba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
17 deletions
+14
-17
drivers/media/dvb/dvb-core/dvbdev.c
drivers/media/dvb/dvb-core/dvbdev.c
+14
-15
drivers/media/dvb/dvb-core/dvbdev.h
drivers/media/dvb/dvb-core/dvbdev.h
+0
-2
No files found.
drivers/media/dvb/dvb-core/dvbdev.c
View file @
cdc053a0
...
...
@@ -45,7 +45,6 @@
static
int
dvbdev_debug
=
0
;
#define dprintk if (dvbdev_debug) printk
static
devfs_handle_t
dvb_devfs_handle
;
static
LIST_HEAD
(
dvb_adapter_list
);
static
DECLARE_MUTEX
(
dvbdev_register_lock
);
...
...
@@ -221,10 +220,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
list_add_tail
(
&
dvbdev
->
list_head
,
&
adap
->
device_list
);
sprintf
(
name
,
"dvb/adapter%d%s%d"
,
adap
->
num
,
dnames
[
type
],
id
);
dvbdev
->
devfs_handle
=
devfs_register
(
NULL
,
name
,
0
,
DVB_MAJOR
,
nums2minor
(
adap
->
num
,
type
,
id
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
dvbdev
->
fops
,
dvbdev
);
devfs_register
(
NULL
,
name
,
0
,
DVB_MAJOR
,
nums2minor
(
adap
->
num
,
type
,
id
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
dvbdev
->
fops
,
dvbdev
);
dprintk
(
"DVB: register adapter%d/%s @ minor: %i (0x%02x)
\n
"
,
adap
->
num
,
name
,
nums2minor
(
adap
->
num
,
type
,
id
),
...
...
@@ -236,12 +233,12 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
void
dvb_unregister_device
(
struct
dvb_device
*
dvbdev
)
{
if
(
!
dvbdev
)
return
;
devfs_unregister
(
dvbdev
->
devfs_handle
);
list_del
(
&
dvbdev
->
list_head
);
kfree
(
dvbdev
);
if
(
dvbdev
)
{
devfs_remove
(
"dvb/adapter%d%s%d"
,
dvbdev
->
adapter
->
num
,
dnames
[
dvbdev
->
type
],
dvbdev
->
id
);
list_del
(
&
dvbdev
->
list_head
);
kfree
(
dvbdev
);
}
}
...
...
@@ -289,11 +286,12 @@ int dvb_register_adapter(struct dvb_adapter **padap, const char *name)
INIT_LIST_HEAD
(
&
adap
->
device_list
);
/* fixme: is this correct? */
/* No */
try_module_get
(
THIS_MODULE
);
printk
(
"DVB: registering new adapter (%s).
\n
"
,
name
);
adap
->
devfs_handle
=
devfs_mk_dir
(
"dvb/adapter%d"
,
num
);
devfs_mk_dir
(
"dvb/adapter%d"
,
num
);
adap
->
num
=
num
;
adap
->
name
=
name
;
...
...
@@ -307,13 +305,14 @@ int dvb_register_adapter(struct dvb_adapter **padap, const char *name)
int
dvb_unregister_adapter
(
struct
dvb_adapter
*
adap
)
{
devfs_unregister
(
adap
->
devfs_handle
);
if
(
down_interruptible
(
&
dvbdev_register_lock
))
return
-
ERESTARTSYS
;
devfs_remove
(
"dvb/adapter%d"
,
adap
->
num
);
list_del
(
&
adap
->
list_head
);
up
(
&
dvbdev_register_lock
);
kfree
(
adap
);
/* fixme: is this correct? */
/* No. */
module_put
(
THIS_MODULE
);
return
0
;
}
...
...
@@ -322,7 +321,7 @@ int dvb_unregister_adapter(struct dvb_adapter *adap)
static
int
__init
init_dvbdev
(
void
)
{
d
vb_devfs_handle
=
devfs_mk_dir
(
"dvb"
);
d
evfs_mk_dir
(
"dvb"
);
#ifndef CONFIG_DVB_DEVFS_ONLY
if
(
register_chrdev
(
DVB_MAJOR
,
"DVB"
,
&
dvb_device_fops
))
{
printk
(
"video_dev: unable to get major %d
\n
"
,
DVB_MAJOR
);
...
...
@@ -339,7 +338,7 @@ void __exit exit_dvbdev(void)
#ifndef CONFIG_DVB_DEVFS_ONLY
unregister_chrdev
(
DVB_MAJOR
,
"DVB"
);
#endif
devfs_
unregister
(
dvb_devfs_handle
);
devfs_
remove
(
"dvb"
);
}
module_init
(
init_dvbdev
);
...
...
drivers/media/dvb/dvb-core/dvbdev.h
View file @
cdc053a0
...
...
@@ -45,7 +45,6 @@
struct
dvb_adapter
{
int
num
;
devfs_handle_t
devfs_handle
;
struct
list_head
list_head
;
struct
list_head
device_list
;
const
char
*
name
;
...
...
@@ -55,7 +54,6 @@ struct dvb_adapter {
struct
dvb_device
{
struct
list_head
list_head
;
struct
file_operations
*
fops
;
devfs_handle_t
devfs_handle
;
struct
dvb_adapter
*
adapter
;
int
type
;
u32
id
;
...
...
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