Merge to Fedora kernel-2.6.7-1.441
[linux-2.6.git] / drivers / usb / gadget / file_storage.c
index 55f4246..df7eb89 100644 (file)
@@ -2501,7 +2501,7 @@ static int send_status(struct fsg_dev *fsg)
                /* Store and send the Bulk-only CSW */
                csw->Signature = __constant_cpu_to_le32(USB_BULK_CS_SIG);
                csw->Tag = fsg->tag;
-               csw->Residue = fsg->residue;
+               csw->Residue = cpu_to_le32(fsg->residue);
                csw->Status = status;
 
                bh->inreq->length = USB_BULK_CS_WRAP_LEN;
@@ -2947,7 +2947,7 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
                fsg->data_dir = DATA_DIR_TO_HOST;
        else
                fsg->data_dir = DATA_DIR_FROM_HOST;
-       fsg->data_size = cbw->DataTransferLength;
+       fsg->data_size = le32_to_cpu(cbw->DataTransferLength);
        if (fsg->data_size == 0)
                fsg->data_dir = DATA_DIR_NONE;
        fsg->lun = cbw->Lun;
@@ -3834,6 +3834,7 @@ static int __init fsg_bind(struct usb_gadget *gadget)
        }
 
        /* Find all the endpoints we will use */
+       usb_ep_autoconfig_reset(gadget);
        ep = usb_ep_autoconfig(gadget, &fs_bulk_in_desc);
        if (!ep)
                goto autoconf_fail;