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
436d67c6
Commit
436d67c6
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] usb cleanup
switched to devfs_remove(), killed gratitious devfs_handle_t field.
parent
b393f4ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
14 deletions
+9
-14
drivers/usb/input/hiddev.c
drivers/usb/input/hiddev.c
+1
-1
drivers/usb/misc/tiglusb.c
drivers/usb/misc/tiglusb.c
+8
-12
drivers/usb/misc/tiglusb.h
drivers/usb/misc/tiglusb.h
+0
-1
No files found.
drivers/usb/input/hiddev.c
View file @
436d67c6
...
@@ -781,6 +781,6 @@ int __init hiddev_init(void)
...
@@ -781,6 +781,6 @@ int __init hiddev_init(void)
void
__exit
hiddev_exit
(
void
)
void
__exit
hiddev_exit
(
void
)
{
{
devfs_unregister
(
hiddev_devfs_handle
);
usb_deregister
(
&
hiddev_driver
);
usb_deregister
(
&
hiddev_driver
);
devfs_remove
(
"usb/hid"
);
}
}
drivers/usb/misc/tiglusb.c
View file @
436d67c6
...
@@ -54,8 +54,6 @@
...
@@ -54,8 +54,6 @@
static
tiglusb_t
tiglusb
[
MAXTIGL
];
static
tiglusb_t
tiglusb
[
MAXTIGL
];
static
int
timeout
=
TIMAXTIME
;
/* timeout in tenth of seconds */
static
int
timeout
=
TIMAXTIME
;
/* timeout in tenth of seconds */
static
devfs_handle_t
devfs_handle
;
/*---------- misc functions ------------------------------------------- */
/*---------- misc functions ------------------------------------------- */
/*
/*
...
@@ -334,7 +332,7 @@ tiglusb_probe (struct usb_interface *intf,
...
@@ -334,7 +332,7 @@ tiglusb_probe (struct usb_interface *intf,
int
minor
=
-
1
;
int
minor
=
-
1
;
int
i
;
int
i
;
ptiglusb_t
s
;
ptiglusb_t
s
;
char
name
[
8
];
char
name
[
32
];
dbg
(
"probing vendor id 0x%x, device id 0x%x"
,
dbg
(
"probing vendor id 0x%x, device id 0x%x"
,
dev
->
descriptor
.
idVendor
,
dev
->
descriptor
.
idProduct
);
dev
->
descriptor
.
idVendor
,
dev
->
descriptor
.
idProduct
);
...
@@ -378,13 +376,12 @@ tiglusb_probe (struct usb_interface *intf,
...
@@ -378,13 +376,12 @@ tiglusb_probe (struct usb_interface *intf,
up
(
&
s
->
mutex
);
up
(
&
s
->
mutex
);
dbg
(
"bound to interface"
);
dbg
(
"bound to interface"
);
sprintf
(
name
,
"%d"
,
s
->
minor
);
sprintf
(
name
,
"
ticables/usb/
%d"
,
s
->
minor
);
dbg
(
"registering to devfs : major = %d, minor = %d, node = %s"
,
dbg
(
"registering to devfs : major = %d, minor = %d, node = %s"
,
TIUSB_MAJOR
,
(
TIUSB_MINOR
+
s
->
minor
),
name
);
TIUSB_MAJOR
,
(
TIUSB_MINOR
+
s
->
minor
),
name
);
s
->
devfs
=
devfs_register
(
NULL
,
name
,
DEVFS_FL_DEFAULT
,
TIUSB_MAJOR
,
devfs_register
(
devfs_handle
,
name
,
DEVFS_FL_DEFAULT
,
TIUSB_MAJOR
,
TIUSB_MINOR
+
s
->
minor
,
S_IFCHR
|
S_IRUGO
|
S_IWUGO
,
TIUSB_MINOR
+
s
->
minor
,
S_IFCHR
|
S_IRUGO
|
S_IWUGO
,
&
tiglusb_fops
,
NULL
);
&
tiglusb_fops
,
NULL
);
/* Display firmware version */
/* Display firmware version */
info
(
"link cable version %i.%02x"
,
info
(
"link cable version %i.%02x"
,
...
@@ -414,8 +411,7 @@ tiglusb_disconnect (struct usb_interface *intf)
...
@@ -414,8 +411,7 @@ tiglusb_disconnect (struct usb_interface *intf)
s
->
dev
=
NULL
;
s
->
dev
=
NULL
;
s
->
opened
=
0
;
s
->
opened
=
0
;
devfs_unregister
(
s
->
devfs
);
devfs_remove
(
name
,
"ticables/usb/%d"
,
s
->
minor
);
s
->
devfs
=
NULL
;
info
(
"device %d removed"
,
s
->
minor
);
info
(
"device %d removed"
,
s
->
minor
);
...
@@ -485,7 +481,7 @@ tiglusb_init (void)
...
@@ -485,7 +481,7 @@ tiglusb_init (void)
}
}
/* Use devfs, tree: /dev/ticables/usb/[0..3] */
/* Use devfs, tree: /dev/ticables/usb/[0..3] */
devfs_
handle
=
devfs_
mk_dir
(
NULL
,
"ticables/usb"
,
NULL
);
devfs_mk_dir
(
NULL
,
"ticables/usb"
,
NULL
);
/* register USB module */
/* register USB module */
result
=
usb_register
(
&
tiglusb_driver
);
result
=
usb_register
(
&
tiglusb_driver
);
...
@@ -506,7 +502,7 @@ static void __exit
...
@@ -506,7 +502,7 @@ static void __exit
tiglusb_cleanup
(
void
)
tiglusb_cleanup
(
void
)
{
{
usb_deregister
(
&
tiglusb_driver
);
usb_deregister
(
&
tiglusb_driver
);
devfs_
unregister
(
devfs_handle
);
devfs_
remove
(
"ticables/usb"
);
unregister_chrdev
(
TIUSB_MAJOR
,
"tiglusb"
);
unregister_chrdev
(
TIUSB_MAJOR
,
"tiglusb"
);
}
}
...
...
drivers/usb/misc/tiglusb.h
View file @
436d67c6
...
@@ -38,7 +38,6 @@ typedef struct
...
@@ -38,7 +38,6 @@ typedef struct
wait_queue_head_t
remove_ok
;
wait_queue_head_t
remove_ok
;
int
minor
;
/* which minor dev #? */
int
minor
;
/* which minor dev #? */
devfs_handle_t
devfs
;
/* devfs device */
driver_state_t
state
;
/* started/stopped */
driver_state_t
state
;
/* started/stopped */
int
opened
;
/* tru if open */
int
opened
;
/* tru if open */
...
...
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