git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
drivers
/
usb
/
serial
/
keyspan.c
diff --git
a/drivers/usb/serial/keyspan.c
b/drivers/usb/serial/keyspan.c
index
7b4f984
..
fb09262
100644
(file)
--- a/
drivers/usb/serial/keyspan.c
+++ b/
drivers/usb/serial/keyspan.c
@@
-342,7
+342,7
@@
static int keyspan_ioctl(struct usb_serial_port *port, struct file *file,
/* Write function is similar for the four protocols used
with only a minor change for usa90 (usa19hs) required */
/* Write function is similar for the four protocols used
with only a minor change for usa90 (usa19hs) required */
-static int keyspan_write(struct usb_serial_port *port,
int from_user,
+static int keyspan_write(struct usb_serial_port *port,
const unsigned char *buf, int count)
{
struct keyspan_port_private *p_priv;
const unsigned char *buf, int count)
{
struct keyspan_port_private *p_priv;
@@
-374,7
+374,7
@@
static int keyspan_write(struct usb_serial_port *port, int from_user,
flip = p_priv->out_flip;
/* Check we have a valid urb/endpoint before we use it... */
flip = p_priv->out_flip;
/* Check we have a valid urb/endpoint before we use it... */
- if ((this_urb = p_priv->out_urbs[flip]) ==
0
) {
+ if ((this_urb = p_priv->out_urbs[flip]) ==
NULL
) {
/* no bulk out, so return 0 bytes written */
dbg("%s - no output urb :(", __FUNCTION__);
return count;
/* no bulk out, so return 0 bytes written */
dbg("%s - no output urb :(", __FUNCTION__);
return count;
@@
-396,12
+396,7
@@
static int keyspan_write(struct usb_serial_port *port, int from_user,
for now so set to zero */
((char *)this_urb->transfer_buffer)[0] = 0;
for now so set to zero */
((char *)this_urb->transfer_buffer)[0] = 0;
- if (from_user) {
- if (copy_from_user(this_urb->transfer_buffer + dataOffset, buf, todo))
- return -EFAULT;
- } else {
- memcpy (this_urb->transfer_buffer + dataOffset, buf, todo);
- }
+ memcpy (this_urb->transfer_buffer + dataOffset, buf, todo);
buf += todo;
/* send the data out the bulk port */
buf += todo;
/* send the data out the bulk port */
@@
-1025,11
+1020,11
@@
static int keyspan_write_room (struct usb_serial_port *port)
flip = p_priv->out_flip;
/* Check both endpoints to see if any are available. */
flip = p_priv->out_flip;
/* Check both endpoints to see if any are available. */
- if ((this_urb = p_priv->out_urbs[flip]) !=
0
) {
+ if ((this_urb = p_priv->out_urbs[flip]) !=
NULL
) {
if (this_urb->status != -EINPROGRESS)
return (data_len);
flip = (flip + 1) & d_details->outdat_endp_flip;
if (this_urb->status != -EINPROGRESS)
return (data_len);
flip = (flip + 1) & d_details->outdat_endp_flip;
- if ((this_urb = p_priv->out_urbs[flip]) !=
0
)
+ if ((this_urb = p_priv->out_urbs[flip]) !=
NULL
)
if (this_urb->status != -EINPROGRESS)
return (data_len);
}
if (this_urb->status != -EINPROGRESS)
return (data_len);
}
@@
-1126,7
+1121,7
@@
static inline void stop_urb(struct urb *urb)
{
if (urb && urb->status == -EINPROGRESS) {
urb->transfer_flags &= ~URB_ASYNC_UNLINK;
{
if (urb && urb->status == -EINPROGRESS) {
urb->transfer_flags &= ~URB_ASYNC_UNLINK;
- usb_
unlink
_urb(urb);
+ usb_
kill
_urb(urb);
}
}
}
}
@@
-1179,16
+1174,16
@@
static int keyspan_fake_startup (struct usb_serial *serial)
char *fw_name;
dbg("Keyspan startup version %04x product %04x",
char *fw_name;
dbg("Keyspan startup version %04x product %04x",
-
serial->dev->descriptor.bcdDevice
,
- serial->dev->descriptor.idProduct);
+
le16_to_cpu(serial->dev->descriptor.bcdDevice)
,
+ le16_to_cpu(serial->dev->descriptor.idProduct));
- if ((
serial->dev->descriptor.bcdDevice
& 0x8000) != 0x8000) {
+ if ((
le16_to_cpu(serial->dev->descriptor.bcdDevice)
& 0x8000) != 0x8000) {
dbg("Firmware already loaded. Quitting.");
return(1);
}
/* Select firmware image on the basis of idProduct */
dbg("Firmware already loaded. Quitting.");
return(1);
}
/* Select firmware image on the basis of idProduct */
- switch (
serial->dev->descriptor.idProduct
) {
+ switch (
le16_to_cpu(serial->dev->descriptor.idProduct)
) {
case keyspan_usa28_pre_product_id:
record = &keyspan_usa28_firmware[0];
fw_name = "USA28";
case keyspan_usa28_pre_product_id:
record = &keyspan_usa28_firmware[0];
fw_name = "USA28";
@@
-2253,10
+2248,10
@@
static int keyspan_startup (struct usb_serial *serial)
dbg("%s", __FUNCTION__);
for (i = 0; (d_details = keyspan_devices[i]) != NULL; ++i)
dbg("%s", __FUNCTION__);
for (i = 0; (d_details = keyspan_devices[i]) != NULL; ++i)
- if (d_details->product_id ==
serial->dev->descriptor.idProduct
)
+ if (d_details->product_id ==
le16_to_cpu(serial->dev->descriptor.idProduct)
)
break;
if (d_details == NULL) {
break;
if (d_details == NULL) {
- dev_err(&serial->dev->dev, "%s - unknown product id %x\n", __FUNCTION__,
serial->dev->descriptor.idProduct
);
+ dev_err(&serial->dev->dev, "%s - unknown product id %x\n", __FUNCTION__,
le16_to_cpu(serial->dev->descriptor.idProduct)
);
return 1;
}
return 1;
}