aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/file_storage.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/file_storage.c')
-rw-r--r--drivers/usb/gadget/file_storage.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index be7a1bd2823b..965ad7bec7b7 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -599,7 +599,6 @@ enum fsg_buffer_state {
599 599
600struct fsg_buffhd { 600struct fsg_buffhd {
601 void *buf; 601 void *buf;
602 dma_addr_t dma;
603 enum fsg_buffer_state state; 602 enum fsg_buffer_state state;
604 struct fsg_buffhd *next; 603 struct fsg_buffhd *next;
605 604
@@ -1295,6 +1294,7 @@ static int class_setup_req(struct fsg_dev *fsg,
1295 struct usb_request *req = fsg->ep0req; 1294 struct usb_request *req = fsg->ep0req;
1296 int value = -EOPNOTSUPP; 1295 int value = -EOPNOTSUPP;
1297 u16 w_index = le16_to_cpu(ctrl->wIndex); 1296 u16 w_index = le16_to_cpu(ctrl->wIndex);
1297 u16 w_value = le16_to_cpu(ctrl->wValue);
1298 u16 w_length = le16_to_cpu(ctrl->wLength); 1298 u16 w_length = le16_to_cpu(ctrl->wLength);
1299 1299
1300 if (!fsg->config) 1300 if (!fsg->config)
@@ -1308,7 +1308,7 @@ static int class_setup_req(struct fsg_dev *fsg,
1308 if (ctrl->bRequestType != (USB_DIR_OUT | 1308 if (ctrl->bRequestType != (USB_DIR_OUT |
1309 USB_TYPE_CLASS | USB_RECIP_INTERFACE)) 1309 USB_TYPE_CLASS | USB_RECIP_INTERFACE))
1310 break; 1310 break;
1311 if (w_index != 0) { 1311 if (w_index != 0 || w_value != 0) {
1312 value = -EDOM; 1312 value = -EDOM;
1313 break; 1313 break;
1314 } 1314 }
@@ -1324,7 +1324,7 @@ static int class_setup_req(struct fsg_dev *fsg,
1324 if (ctrl->bRequestType != (USB_DIR_IN | 1324 if (ctrl->bRequestType != (USB_DIR_IN |
1325 USB_TYPE_CLASS | USB_RECIP_INTERFACE)) 1325 USB_TYPE_CLASS | USB_RECIP_INTERFACE))
1326 break; 1326 break;
1327 if (w_index != 0) { 1327 if (w_index != 0 || w_value != 0) {
1328 value = -EDOM; 1328 value = -EDOM;
1329 break; 1329 break;
1330 } 1330 }
@@ -1343,7 +1343,7 @@ static int class_setup_req(struct fsg_dev *fsg,
1343 if (ctrl->bRequestType != (USB_DIR_OUT | 1343 if (ctrl->bRequestType != (USB_DIR_OUT |
1344 USB_TYPE_CLASS | USB_RECIP_INTERFACE)) 1344 USB_TYPE_CLASS | USB_RECIP_INTERFACE))
1345 break; 1345 break;
1346 if (w_index != 0) { 1346 if (w_index != 0 || w_value != 0) {
1347 value = -EDOM; 1347 value = -EDOM;
1348 break; 1348 break;
1349 } 1349 }
@@ -2611,7 +2611,6 @@ static int send_status(struct fsg_dev *fsg)
2611 2611
2612 fsg->intr_buffhd = bh; // Point to the right buffhd 2612 fsg->intr_buffhd = bh; // Point to the right buffhd
2613 fsg->intreq->buf = bh->inreq->buf; 2613 fsg->intreq->buf = bh->inreq->buf;
2614 fsg->intreq->dma = bh->inreq->dma;
2615 fsg->intreq->context = bh; 2614 fsg->intreq->context = bh;
2616 start_transfer(fsg, fsg->intr_in, fsg->intreq, 2615 start_transfer(fsg, fsg->intr_in, fsg->intreq,
2617 &fsg->intreq_busy, &bh->state); 2616 &fsg->intreq_busy, &bh->state);
@@ -3200,7 +3199,6 @@ reset:
3200 if ((rc = alloc_request(fsg, fsg->bulk_out, &bh->outreq)) != 0) 3199 if ((rc = alloc_request(fsg, fsg->bulk_out, &bh->outreq)) != 0)
3201 goto reset; 3200 goto reset;
3202 bh->inreq->buf = bh->outreq->buf = bh->buf; 3201 bh->inreq->buf = bh->outreq->buf = bh->buf;
3203 bh->inreq->dma = bh->outreq->dma = bh->dma;
3204 bh->inreq->context = bh->outreq->context = bh; 3202 bh->inreq->context = bh->outreq->context = bh;
3205 bh->inreq->complete = bulk_in_complete; 3203 bh->inreq->complete = bulk_in_complete;
3206 bh->outreq->complete = bulk_out_complete; 3204 bh->outreq->complete = bulk_out_complete;