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
81897611
Commit
81897611
authored
May 06, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: converted rio500 over to new usb_register_dev() changes.
parent
e19168ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
drivers/usb/misc/rio500.c
drivers/usb/misc/rio500.c
+12
-16
No files found.
drivers/usb/misc/rio500.c
View file @
81897611
...
...
@@ -38,7 +38,6 @@
#include <linux/spinlock.h>
#include <linux/usb.h>
#include <linux/smp_lock.h>
#include <linux/devfs_fs_kernel.h>
#include "rio500_usb.h"
...
...
@@ -49,11 +48,7 @@
#define DRIVER_AUTHOR "Cesar Miquel <miquel@df.uba.ar>"
#define DRIVER_DESC "USB Rio 500 driver"
#ifdef CONFIG_USB_DYNAMIC_MINORS
#define RIO_MINOR 0
#else
#define RIO_MINOR 64
#endif
#define RIO_MINOR 64
/* stall/wait timeout for rio */
#define NAK_TIMEOUT (HZ)
...
...
@@ -68,7 +63,6 @@ struct rio_usb_data {
unsigned
int
ifnum
;
/* Interface number of the USB device */
int
isopen
;
/* nz if open */
int
present
;
/* Device is present on the bus */
int
minor
;
/* minor number assigned to us */
char
*
obuf
,
*
ibuf
;
/* transfer buffers */
char
bulk_in_ep
,
bulk_out_ep
;
/* Endpoint assignments */
wait_queue_head_t
wait_q
;
/* for timeouts */
...
...
@@ -444,6 +438,13 @@ file_operations usb_rio_fops = {
.
release
=
close_rio
,
};
static
struct
usb_class_driver
usb_rio_class
=
{
.
name
=
"usb/rio500%d"
,
.
fops
=
&
usb_rio_fops
,
.
mode
=
S_IFCHR
|
S_IRUSR
|
S_IWUSR
|
S_IRGRP
|
S_IWGRP
,
.
minor_base
=
RIO_MINOR
,
};
static
int
probe_rio
(
struct
usb_interface
*
intf
,
const
struct
usb_device_id
*
id
)
{
...
...
@@ -453,7 +454,7 @@ static int probe_rio(struct usb_interface *intf,
info
(
"USB Rio found at address %d"
,
dev
->
devnum
);
retval
=
usb_register_dev
(
&
usb_rio_fops
,
RIO_MINOR
,
1
,
&
rio
->
minor
);
retval
=
usb_register_dev
(
intf
,
&
usb_rio_class
);
if
(
retval
)
{
err
(
"Not able to get a minor for this device."
);
return
-
ENOMEM
;
...
...
@@ -464,23 +465,19 @@ static int probe_rio(struct usb_interface *intf,
if
(
!
(
rio
->
obuf
=
(
char
*
)
kmalloc
(
OBUF_SIZE
,
GFP_KERNEL
)))
{
err
(
"probe_rio: Not enough memory for the output buffer"
);
usb_deregister_dev
(
intf
,
&
usb_rio_class
);
return
-
ENOMEM
;
}
dbg
(
"probe_rio: obuf address:%p"
,
rio
->
obuf
);
if
(
!
(
rio
->
ibuf
=
(
char
*
)
kmalloc
(
IBUF_SIZE
,
GFP_KERNEL
)))
{
err
(
"probe_rio: Not enough memory for the input buffer"
);
usb_deregister_dev
(
intf
,
&
usb_rio_class
);
kfree
(
rio
->
obuf
);
return
-
ENOMEM
;
}
dbg
(
"probe_rio: ibuf address:%p"
,
rio
->
ibuf
);
devfs_register
(
NULL
,
"usb/rio500"
,
DEVFS_FL_DEFAULT
,
USB_MAJOR
,
RIO_MINOR
,
S_IFCHR
|
S_IRUSR
|
S_IWUSR
|
S_IRGRP
|
S_IWGRP
,
&
usb_rio_fops
,
NULL
);
init_MUTEX
(
&
(
rio
->
lock
));
usb_set_intfdata
(
intf
,
rio
);
...
...
@@ -493,8 +490,7 @@ static void disconnect_rio(struct usb_interface *intf)
usb_set_intfdata
(
intf
,
NULL
);
if
(
rio
)
{
devfs_remove
(
"usb/rio500"
);
usb_deregister_dev
(
1
,
rio
->
minor
);
usb_deregister_dev
(
intf
,
&
usb_rio_class
);
down
(
&
(
rio
->
lock
));
if
(
rio
->
isopen
)
{
...
...
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