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
f88f81ef
Commit
f88f81ef
authored
Dec 03, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Dec 03, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] tipar cleanup
switched to devfs_remove(), killed gratitious devfs_handle_t variable.
parent
32feff07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
drivers/char/tipar.c
drivers/char/tipar.c
+6
-6
No files found.
drivers/char/tipar.c
View file @
f88f81ef
...
@@ -90,7 +90,6 @@ static struct tipar_struct table[PP_NO];
...
@@ -90,7 +90,6 @@ static struct tipar_struct table[PP_NO];
static
int
delay
=
IO_DELAY
;
/* inter-bit delay in microseconds */
static
int
delay
=
IO_DELAY
;
/* inter-bit delay in microseconds */
static
int
timeout
=
TIMAXTIME
;
/* timeout in tenth of seconds */
static
int
timeout
=
TIMAXTIME
;
/* timeout in tenth of seconds */
static
devfs_handle_t
devfs_handle
;
static
unsigned
int
tp_count
;
/* tipar count */
static
unsigned
int
tp_count
;
/* tipar count */
static
unsigned
long
opened
;
/* opened devices */
static
unsigned
long
opened
;
/* opened devices */
...
@@ -422,7 +421,7 @@ tipar_setup(char *str)
...
@@ -422,7 +421,7 @@ tipar_setup(char *str)
static
int
static
int
tipar_register
(
int
nr
,
struct
parport
*
port
)
tipar_register
(
int
nr
,
struct
parport
*
port
)
{
{
char
name
[
8
];
char
name
[
32
];
/* Register our module into parport */
/* Register our module into parport */
table
[
nr
].
dev
=
parport_register_device
(
port
,
"tipar"
,
table
[
nr
].
dev
=
parport_register_device
(
port
,
"tipar"
,
...
@@ -433,11 +432,11 @@ tipar_register(int nr, struct parport *port)
...
@@ -433,11 +432,11 @@ tipar_register(int nr, struct parport *port)
return
1
;
return
1
;
/* Use devfs, tree: /dev/ticables/par/[0..2] */
/* Use devfs, tree: /dev/ticables/par/[0..2] */
sprintf
(
name
,
"%d"
,
nr
);
sprintf
(
name
,
"
ticables/par/
%d"
,
nr
);
printk
printk
(
"tipar: registering to devfs : major = %d, minor = %d, node = %s
\n
"
,
(
"tipar: registering to devfs : major = %d, minor = %d, node = %s
\n
"
,
TISER_MAJOR
,
(
TIPAR_MINOR
+
nr
),
name
);
TISER_MAJOR
,
(
TIPAR_MINOR
+
nr
),
name
);
devfs_register
(
devfs_handle
,
name
,
DEVFS_FL_DEFAULT
,
TIPAR_MAJOR
,
devfs_register
(
NULL
,
name
,
DEVFS_FL_DEFAULT
,
TIPAR_MAJOR
,
TIPAR_MINOR
+
nr
,
S_IFCHR
|
S_IRUGO
|
S_IWUGO
,
TIPAR_MINOR
+
nr
,
S_IFCHR
|
S_IRUGO
|
S_IWUGO
,
&
tipar_fops
,
NULL
);
&
tipar_fops
,
NULL
);
...
@@ -491,7 +490,7 @@ tipar_init_module(void)
...
@@ -491,7 +490,7 @@ tipar_init_module(void)
}
}
/* Use devfs with tree: /dev/ticables/par/[0..2] */
/* Use devfs with tree: /dev/ticables/par/[0..2] */
devfs_
handle
=
devfs_
mk_dir
(
NULL
,
"ticables/par"
,
NULL
);
devfs_mk_dir
(
NULL
,
"ticables/par"
,
NULL
);
if
(
parport_register_driver
(
&
tipar_driver
))
{
if
(
parport_register_driver
(
&
tipar_driver
))
{
printk
(
"tipar: unable to register with parport
\n
"
);
printk
(
"tipar: unable to register with parport
\n
"
);
...
@@ -509,14 +508,15 @@ tipar_cleanup_module(void)
...
@@ -509,14 +508,15 @@ tipar_cleanup_module(void)
/* Unregistering module */
/* Unregistering module */
parport_unregister_driver
(
&
tipar_driver
);
parport_unregister_driver
(
&
tipar_driver
);
devfs_unregister
(
devfs_handle
);
unregister_chrdev
(
TIPAR_MAJOR
,
"tipar"
);
unregister_chrdev
(
TIPAR_MAJOR
,
"tipar"
);
for
(
i
=
0
;
i
<
PP_NO
;
i
++
)
{
for
(
i
=
0
;
i
<
PP_NO
;
i
++
)
{
if
(
table
[
i
].
dev
==
NULL
)
if
(
table
[
i
].
dev
==
NULL
)
continue
;
continue
;
parport_unregister_device
(
table
[
i
].
dev
);
parport_unregister_device
(
table
[
i
].
dev
);
devfs_remove
(
"ticables/par/%d"
,
i
);
}
}
devfs_remove
(
"ticables/par"
);
printk
(
"tipar: module unloaded !
\n
"
);
printk
(
"tipar: module unloaded !
\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