Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] usb: freecom & sddr09 - convert to accessors and !use_sg cleanup

- Use scsi data accessors and remove of !use_sg code path
- This patch is dependent on cleanup patch to usb transport.c/h

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

authored by

Boaz Harrosh and committed by
James Bottomley
41c2497b dd829d23

+9 -14
+6 -8
drivers/usb/storage/freecom.c
··· 132 132 133 133 /* Now transfer all of our blocks. */ 134 134 US_DEBUGP("Start of read\n"); 135 - result = usb_stor_bulk_transfer_sg(us, ipipe, srb->request_buffer, 136 - count, srb->use_sg, &srb->resid); 135 + result = usb_stor_bulk_srb(us, ipipe, srb); 137 136 US_DEBUGP("freecom_readdata done!\n"); 138 137 139 138 if (result > USB_STOR_XFER_SHORT) ··· 165 166 166 167 /* Now transfer all of our blocks. */ 167 168 US_DEBUGP("Start of write\n"); 168 - result = usb_stor_bulk_transfer_sg(us, opipe, srb->request_buffer, 169 - count, srb->use_sg, &srb->resid); 169 + result = usb_stor_bulk_srb(us, opipe, srb); 170 170 171 171 US_DEBUGP("freecom_writedata done!\n"); 172 172 if (result > USB_STOR_XFER_SHORT) ··· 279 281 * and such will hang. */ 280 282 US_DEBUGP("Device indicates that it has %d bytes available\n", 281 283 le16_to_cpu (fst->Count)); 282 - US_DEBUGP("SCSI requested %d\n", srb->request_bufflen); 284 + US_DEBUGP("SCSI requested %d\n", scsi_bufflen(srb)); 283 285 284 286 /* Find the length we desire to read. */ 285 287 switch (srb->cmnd[0]) { ··· 290 292 length = le16_to_cpu(fst->Count); 291 293 break; 292 294 default: 293 - length = srb->request_bufflen; 295 + length = scsi_bufflen(srb); 294 296 } 295 297 296 298 /* verify that this amount is legal */ 297 - if (length > srb->request_bufflen) { 298 - length = srb->request_bufflen; 299 + if (length > scsi_bufflen(srb)) { 300 + length = scsi_bufflen(srb); 299 301 US_DEBUGP("Truncating request to match buffer length: %d\n", length); 300 302 } 301 303
+3 -6
drivers/usb/storage/sddr09.c
··· 1623 1623 return USB_STOR_TRANSPORT_ERROR; 1624 1624 } 1625 1625 1626 - if (srb->request_bufflen == 0) 1626 + if (scsi_bufflen(srb) == 0) 1627 1627 return USB_STOR_TRANSPORT_GOOD; 1628 1628 1629 1629 if (srb->sc_data_direction == DMA_TO_DEVICE || ··· 1634 1634 US_DEBUGP("SDDR09: %s %d bytes\n", 1635 1635 (srb->sc_data_direction == DMA_TO_DEVICE) ? 1636 1636 "sending" : "receiving", 1637 - srb->request_bufflen); 1637 + scsi_bufflen(srb)); 1638 1638 1639 - result = usb_stor_bulk_transfer_sg(us, pipe, 1640 - srb->request_buffer, 1641 - srb->request_bufflen, 1642 - srb->use_sg, &srb->resid); 1639 + result = usb_stor_bulk_srb(us, pipe, srb); 1643 1640 1644 1641 return (result == USB_STOR_XFER_GOOD ? 1645 1642 USB_STOR_TRANSPORT_GOOD : USB_STOR_TRANSPORT_ERROR);