diff options
author | David Brownell <david-b@pacbell.net> | 2005-05-07 16:05:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-27 17:43:53 -0400 |
commit | 1bbc169621cbe502b9143a27eb12802a0f1d43a0 (patch) | |
tree | a8fc4a429d890ea02ef1084ec3ffb2a9b9ef9c61 /drivers/usb/gadget/inode.c | |
parent | 028b271b687714f9fc7a1e89bb79f1fbeef154ee (diff) |
[PATCH] USB: gadget driver updates (SETUP api change)
This updates most of the gadget framework to expect SETUP packets use
USB byteorder (matching the annotation in <linux/usb_ch9.h> and usage
in the host side stack):
- definition in <linux/usb_gadget.h>
- gadget drivers: Ethernet/RNDIS, serial/ACM, file_storage, gadgetfs.
- dummy_hcd
It also includes some other similar changes as suggested by "sparse",
which was used to detect byteorder bugs.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/inode.c')
-rw-r--r-- | drivers/usb/gadget/inode.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index 1e5e6ddef787..020815397a49 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c | |||
@@ -417,8 +417,8 @@ ep_read (struct file *fd, char __user *buf, size_t len, loff_t *ptr) | |||
417 | goto free1; | 417 | goto free1; |
418 | 418 | ||
419 | value = ep_io (data, kbuf, len); | 419 | value = ep_io (data, kbuf, len); |
420 | VDEBUG (data->dev, "%s read %d OUT, status %d\n", | 420 | VDEBUG (data->dev, "%s read %zu OUT, status %d\n", |
421 | data->name, len, value); | 421 | data->name, len, (int) value); |
422 | if (value >= 0 && copy_to_user (buf, kbuf, value)) | 422 | if (value >= 0 && copy_to_user (buf, kbuf, value)) |
423 | value = -EFAULT; | 423 | value = -EFAULT; |
424 | 424 | ||
@@ -465,8 +465,8 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr) | |||
465 | } | 465 | } |
466 | 466 | ||
467 | value = ep_io (data, kbuf, len); | 467 | value = ep_io (data, kbuf, len); |
468 | VDEBUG (data->dev, "%s write %d IN, status %d\n", | 468 | VDEBUG (data->dev, "%s write %zu IN, status %d\n", |
469 | data->name, len, value); | 469 | data->name, len, (int) value); |
470 | free1: | 470 | free1: |
471 | up (&data->lock); | 471 | up (&data->lock); |
472 | kfree (kbuf); | 472 | kfree (kbuf); |
@@ -1318,8 +1318,8 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) | |||
1318 | struct usb_request *req = dev->req; | 1318 | struct usb_request *req = dev->req; |
1319 | int value = -EOPNOTSUPP; | 1319 | int value = -EOPNOTSUPP; |
1320 | struct usb_gadgetfs_event *event; | 1320 | struct usb_gadgetfs_event *event; |
1321 | u16 w_value = ctrl->wValue; | 1321 | u16 w_value = le16_to_cpu(ctrl->wValue); |
1322 | u16 w_length = ctrl->wLength; | 1322 | u16 w_length = le16_to_cpu(ctrl->wLength); |
1323 | 1323 | ||
1324 | spin_lock (&dev->lock); | 1324 | spin_lock (&dev->lock); |
1325 | dev->setup_abort = 0; | 1325 | dev->setup_abort = 0; |