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
83c0aee5
Commit
83c0aee5
authored
May 06, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USB: converted hiddev over to new usb_register_dev() changes.
parent
dc58a892
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
drivers/usb/input/hiddev.c
drivers/usb/input/hiddev.c
+19
-18
No files found.
drivers/usb/input/hiddev.c
View file @
83c0aee5
...
...
@@ -53,6 +53,7 @@ struct hiddev {
wait_queue_head_t
wait
;
struct
hid_device
*
hid
;
struct
hiddev_list
*
list
;
struct
usb_interface
intf
;
};
struct
hiddev_list
{
...
...
@@ -226,10 +227,10 @@ static int hiddev_fasync(int fd, struct file *file, int on)
/*
* De-allocate a hiddev structure
*/
static
struct
usb_class_driver
hiddev_class
;
static
void
hiddev_cleanup
(
struct
hiddev
*
hiddev
)
{
devfs_remove
(
"usb/hid/hiddev%d"
,
hiddev
->
minor
);
usb_deregister_dev
(
1
,
hiddev
->
minor
);
usb_deregister_dev
(
&
hiddev
->
intf
,
&
hiddev_class
);
hiddev_table
[
hiddev
->
minor
]
=
NULL
;
kfree
(
hiddev
);
}
...
...
@@ -675,15 +676,21 @@ static struct file_operations hiddev_fops = {
.
fasync
=
hiddev_fasync
,
};
static
struct
usb_class_driver
hiddev_class
=
{
.
name
=
"usb/hid/hiddev%d"
,
.
fops
=
&
hiddev_fops
,
.
mode
=
S_IFCHR
|
S_IRUGO
|
S_IWUSR
,
.
minor_base
=
HIDDEV_MINOR_BASE
,
};
/*
* This is where hid.c calls us to connect a hid device to the hiddev driver
*/
int
hiddev_connect
(
struct
hid_device
*
hid
)
{
struct
hiddev
*
hiddev
;
int
minor
,
i
;
int
i
;
int
retval
;
char
devfs_name
[
24
];
for
(
i
=
0
;
i
<
hid
->
maxcollection
;
i
++
)
if
(
hid
->
collection
[
i
].
type
==
...
...
@@ -694,31 +701,25 @@ int hiddev_connect(struct hid_device *hid)
if
(
i
==
hid
->
maxcollection
&&
(
hid
->
quirks
&
HID_QUIRK_HIDDEV
)
==
0
)
return
-
1
;
retval
=
usb_register_dev
(
&
hiddev_fops
,
HIDDEV_MINOR_BASE
,
1
,
&
minor
);
if
(
retval
)
{
err
(
"Not able to get a minor for this device."
);
if
(
!
(
hiddev
=
kmalloc
(
sizeof
(
struct
hiddev
),
GFP_KERNEL
)))
return
-
1
;
}
memset
(
hiddev
,
0
,
sizeof
(
struct
hiddev
));
if
(
!
(
hiddev
=
kmalloc
(
sizeof
(
struct
hiddev
),
GFP_KERNEL
)))
{
usb_deregister_dev
(
1
,
minor
);
retval
=
usb_register_dev
(
&
hiddev
->
intf
,
&
hiddev_class
);
if
(
retval
)
{
err
(
"Not able to get a minor for this device."
);
return
-
1
;
}
memset
(
hiddev
,
0
,
sizeof
(
struct
hiddev
));
init_waitqueue_head
(
&
hiddev
->
wait
);
hiddev
->
minor
=
minor
;
hiddev_table
[
minor
-
HIDDEV_MINOR_BASE
]
=
hiddev
;
hiddev
->
minor
=
hiddev
->
intf
.
minor
;
hiddev_table
[
hiddev
->
intf
.
minor
-
HIDDEV_MINOR_BASE
]
=
hiddev
;
hiddev
->
hid
=
hid
;
hiddev
->
exist
=
1
;
sprintf
(
devfs_name
,
"usb/hid/hiddev%d"
,
minor
);
devfs_register
(
NULL
,
devfs_name
,
0
,
USB_MAJOR
,
minor
+
HIDDEV_MINOR_BASE
,
S_IFCHR
|
S_IRUGO
|
S_IWUSR
,
&
hiddev_fops
,
NULL
);
hid
->
minor
=
minor
;
hid
->
minor
=
hiddev
->
intf
.
minor
;
hid
->
hiddev
=
hiddev
;
return
0
;
...
...
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