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
3dba28d8
Commit
3dba28d8
authored
Dec 11, 2002
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: Fix compile errors with usb-skeleton driver.
parent
6e43d962
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
drivers/usb/usb-skeleton.c
drivers/usb/usb-skeleton.c
+17
-17
No files found.
drivers/usb/usb-skeleton.c
View file @
3dba28d8
...
@@ -238,9 +238,9 @@ static int skel_open (struct inode *inode, struct file *file)
...
@@ -238,9 +238,9 @@ static int skel_open (struct inode *inode, struct file *file)
int
subminor
;
int
subminor
;
int
retval
=
0
;
int
retval
=
0
;
dbg
(
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
subminor
=
MINOR
(
inode
->
i_rdev
)
-
USB_SKEL_MINOR_BASE
;
subminor
=
minor
(
inode
->
i_rdev
)
-
USB_SKEL_MINOR_BASE
;
if
((
subminor
<
0
)
||
if
((
subminor
<
0
)
||
(
subminor
>=
MAX_DEVICES
))
{
(
subminor
>=
MAX_DEVICES
))
{
return
-
ENODEV
;
return
-
ENODEV
;
...
@@ -291,11 +291,11 @@ static int skel_release (struct inode *inode, struct file *file)
...
@@ -291,11 +291,11 @@ static int skel_release (struct inode *inode, struct file *file)
dev
=
(
struct
usb_skel
*
)
file
->
private_data
;
dev
=
(
struct
usb_skel
*
)
file
->
private_data
;
if
(
dev
==
NULL
)
{
if
(
dev
==
NULL
)
{
dbg
(
__FUNCTION__
" - object is NULL"
);
dbg
(
"%s - object is NULL"
,
__FUNCTION__
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
dbg
(
__FUNCTION__
" - minor %d"
,
dev
->
minor
);
dbg
(
"%s - minor %d"
,
__FUNCTION__
,
dev
->
minor
);
/* lock our minor table */
/* lock our minor table */
down
(
&
minor_table_mutex
);
down
(
&
minor_table_mutex
);
...
@@ -304,7 +304,7 @@ static int skel_release (struct inode *inode, struct file *file)
...
@@ -304,7 +304,7 @@ static int skel_release (struct inode *inode, struct file *file)
down
(
&
dev
->
sem
);
down
(
&
dev
->
sem
);
if
(
dev
->
open_count
<=
0
)
{
if
(
dev
->
open_count
<=
0
)
{
dbg
(
__FUNCTION__
" - device not opened"
);
dbg
(
"%s - device not opened"
,
__FUNCTION__
);
retval
=
-
ENODEV
;
retval
=
-
ENODEV
;
goto
exit_not_opened
;
goto
exit_not_opened
;
}
}
...
@@ -347,7 +347,7 @@ static ssize_t skel_read (struct file *file, char *buffer, size_t count, loff_t
...
@@ -347,7 +347,7 @@ static ssize_t skel_read (struct file *file, char *buffer, size_t count, loff_t
dev
=
(
struct
usb_skel
*
)
file
->
private_data
;
dev
=
(
struct
usb_skel
*
)
file
->
private_data
;
dbg
(
__FUNCTION__
" - minor %d, count = %d"
,
dev
->
minor
,
count
);
dbg
(
"%s - minor %d, count = %d"
,
__FUNCTION__
,
dev
->
minor
,
count
);
/* lock this object */
/* lock this object */
down
(
&
dev
->
sem
);
down
(
&
dev
->
sem
);
...
@@ -390,7 +390,7 @@ static ssize_t skel_write (struct file *file, const char *buffer, size_t count,
...
@@ -390,7 +390,7 @@ static ssize_t skel_write (struct file *file, const char *buffer, size_t count,
dev
=
(
struct
usb_skel
*
)
file
->
private_data
;
dev
=
(
struct
usb_skel
*
)
file
->
private_data
;
dbg
(
__FUNCTION__
" - minor %d, count = %d"
,
dev
->
minor
,
count
);
dbg
(
"%s - minor %d, count = %d"
,
__FUNCTION__
,
dev
->
minor
,
count
);
/* lock this object */
/* lock this object */
down
(
&
dev
->
sem
);
down
(
&
dev
->
sem
);
...
@@ -403,13 +403,13 @@ static ssize_t skel_write (struct file *file, const char *buffer, size_t count,
...
@@ -403,13 +403,13 @@ static ssize_t skel_write (struct file *file, const char *buffer, size_t count,
/* verify that we actually have some data to write */
/* verify that we actually have some data to write */
if
(
count
==
0
)
{
if
(
count
==
0
)
{
dbg
(
__FUNCTION__
" - write request of 0 bytes"
);
dbg
(
"%s - write request of 0 bytes"
,
__FUNCTION__
);
goto
exit
;
goto
exit
;
}
}
/* see if we are already in the middle of a write */
/* see if we are already in the middle of a write */
if
(
dev
->
write_urb
->
status
==
-
EINPROGRESS
)
{
if
(
dev
->
write_urb
->
status
==
-
EINPROGRESS
)
{
dbg
(
__FUNCTION__
" - already writing"
);
dbg
(
"%s - already writing"
,
__FUNCTION__
);
goto
exit
;
goto
exit
;
}
}
...
@@ -438,8 +438,8 @@ static ssize_t skel_write (struct file *file, const char *buffer, size_t count,
...
@@ -438,8 +438,8 @@ static ssize_t skel_write (struct file *file, const char *buffer, size_t count,
unless a spinlock is held */
unless a spinlock is held */
retval
=
usb_submit_urb
(
dev
->
write_urb
,
GFP_KERNEL
);
retval
=
usb_submit_urb
(
dev
->
write_urb
,
GFP_KERNEL
);
if
(
retval
)
{
if
(
retval
)
{
err
(
__FUNCTION__
"
- failed submitting write urb, error %d"
,
err
(
"%s
- failed submitting write urb, error %d"
,
retval
);
__FUNCTION__
,
retval
);
}
else
{
}
else
{
retval
=
bytes_written
;
retval
=
bytes_written
;
}
}
...
@@ -470,7 +470,7 @@ static int skel_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
...
@@ -470,7 +470,7 @@ static int skel_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
return
-
ENODEV
;
return
-
ENODEV
;
}
}
dbg
(
__FUNCTION__
" - minor %d, cmd 0x%.4x, arg %ld"
,
dbg
(
"%s - minor %d, cmd 0x%.4x, arg %ld"
,
__FUNCTION__
,
dev
->
minor
,
cmd
,
arg
);
dev
->
minor
,
cmd
,
arg
);
...
@@ -491,12 +491,12 @@ static void skel_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
...
@@ -491,12 +491,12 @@ static void skel_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
{
{
struct
usb_skel
*
dev
=
(
struct
usb_skel
*
)
urb
->
context
;
struct
usb_skel
*
dev
=
(
struct
usb_skel
*
)
urb
->
context
;
dbg
(
__FUNCTION__
" - minor %d"
,
dev
->
minor
);
dbg
(
"%s - minor %d"
,
__FUNCTION__
,
dev
->
minor
);
if
((
urb
->
status
!=
-
ENOENT
)
&&
if
((
urb
->
status
!=
-
ENOENT
)
&&
(
urb
->
status
!=
-
ECONNRESET
))
{
(
urb
->
status
!=
-
ECONNRESET
))
{
dbg
(
__FUNCTION__
"
- nonzero write bulk status received: %d"
,
dbg
(
"%s
- nonzero write bulk status received: %d"
,
urb
->
status
);
__FUNCTION__
,
urb
->
status
);
return
;
return
;
}
}
...
@@ -514,7 +514,7 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i
...
@@ -514,7 +514,7 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i
{
{
struct
usb_device
*
udev
=
interface_to_usbdev
(
interface
);
struct
usb_device
*
udev
=
interface_to_usbdev
(
interface
);
struct
usb_skel
*
dev
=
NULL
;
struct
usb_skel
*
dev
=
NULL
;
struct
usb_
interface_descriptor
*
iface_desc
;
struct
usb_
host_interface
*
iface_desc
;
struct
usb_endpoint_descriptor
*
endpoint
;
struct
usb_endpoint_descriptor
*
endpoint
;
int
minor
;
int
minor
;
int
buffer_size
;
int
buffer_size
;
...
@@ -554,7 +554,7 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i
...
@@ -554,7 +554,7 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i
/* set up the endpoint information */
/* set up the endpoint information */
/* check out the endpoints */
/* check out the endpoints */
iface_desc
=
&
interface
->
altsetting
[
0
];
iface_desc
=
&
interface
->
altsetting
[
0
];
for
(
i
=
0
;
i
<
iface_desc
->
bNumEndpoints
;
++
i
)
{
for
(
i
=
0
;
i
<
iface_desc
->
desc
.
bNumEndpoints
;
++
i
)
{
endpoint
=
&
iface_desc
->
endpoint
[
i
].
desc
;
endpoint
=
&
iface_desc
->
endpoint
[
i
].
desc
;
if
((
endpoint
->
bEndpointAddress
&
0x80
)
&&
if
((
endpoint
->
bEndpointAddress
&
0x80
)
&&
...
...
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