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
ced55da1
Commit
ced55da1
authored
May 06, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: converted dabusb over to new usb_register_dev() changes.
parent
2d67b792
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
drivers/usb/media/dabusb.c
drivers/usb/media/dabusb.c
+12
-5
drivers/usb/media/dabusb.h
drivers/usb/media/dabusb.h
+0
-4
No files found.
drivers/usb/media/dabusb.c
View file @
ced55da1
...
...
@@ -712,12 +712,19 @@ static struct file_operations dabusb_fops =
.
release
=
dabusb_release
,
};
static
struct
usb_class_driver
dabusb_class
=
{
.
name
=
"usb/dabusb%d"
,
.
fops
=
&
dabusb_fops
,
.
mode
=
S_IFCHR
|
S_IRUSR
|
S_IWUSR
|
S_IRGRP
|
S_IWGRP
,
.
minor_base
=
DABUSB_MINOR
,
};
/* --------------------------------------------------------------------- */
static
int
dabusb_probe
(
struct
usb_interface
*
intf
,
const
struct
usb_device_id
*
id
)
{
struct
usb_device
*
usbdev
=
interface_to_usbdev
(
intf
);
int
devnum
;
int
retval
;
pdabusb_t
s
;
...
...
@@ -731,16 +738,16 @@ static int dabusb_probe (struct usb_interface *intf,
if
(
intf
->
altsetting
->
desc
.
bInterfaceNumber
!=
_DABUSB_IF
&&
usbdev
->
descriptor
.
idProduct
==
0x9999
)
return
-
ENODEV
;
retval
=
usb_register_dev
(
&
dabusb_fops
,
DABUSB_MINOR
,
1
,
&
devnum
);
retval
=
usb_register_dev
(
intf
,
&
dabusb_class
);
if
(
retval
)
return
-
ENOMEM
;
s
=
&
dabusb
[
devnum
];
s
=
&
dabusb
[
intf
->
minor
];
down
(
&
s
->
mutex
);
s
->
remove_pending
=
0
;
s
->
usbdev
=
usbdev
;
s
->
devnum
=
devnum
;
s
->
devnum
=
intf
->
minor
;
if
(
usb_set_configuration
(
usbdev
,
usbdev
->
config
[
0
].
desc
.
bConfigurationValue
)
<
0
)
{
err
(
"set_configuration failed"
);
...
...
@@ -778,7 +785,7 @@ static void dabusb_disconnect (struct usb_interface *intf)
usb_set_intfdata
(
intf
,
NULL
);
if
(
s
)
{
usb_deregister_dev
(
1
,
s
->
devnum
);
usb_deregister_dev
(
intf
,
&
dabusb_class
);
s
->
remove_pending
=
1
;
wake_up
(
&
s
->
wait
);
if
(
s
->
state
==
_started
)
...
...
drivers/usb/media/dabusb.h
View file @
ced55da1
...
...
@@ -6,11 +6,7 @@ typedef struct
unsigned
int
pipe
;
}
bulk_transfer_t
,
*
pbulk_transfer_t
;
#ifdef CONFIG_USB_DYNAMIC_MINORS
#define DABUSB_MINOR 0
#else
#define DABUSB_MINOR 240
/* some unassigned USB minor */
#endif
#define DABUSB_VERSION 0x1000
#define IOCTL_DAB_BULK _IOWR('d', 0x30, bulk_transfer_t)
#define IOCTL_DAB_OVERRUNS _IOR('d', 0x15, int)
...
...
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