]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/storage/shuttle_usbat.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6-omap-h63xx.git] / drivers / usb / storage / shuttle_usbat.c
index 8fcec01dc622f29f9fb3f8e6c50030b523b16730..cb22a9ad16943cfbccdef9356651c1fa4f499342 100644 (file)
@@ -43,7 +43,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/cdrom.h>
@@ -191,9 +190,6 @@ static int usbat_check_status(struct us_data *us)
        unsigned char *reply = us->iobuf;
        int rc;
 
-       if (!us)
-               return USB_STOR_TRANSPORT_ERROR;
-
        rc = usbat_get_status(us, reply);
        if (rc != USB_STOR_XFER_GOOD)
                return USB_STOR_TRANSPORT_FAILED;
@@ -997,7 +993,8 @@ static int usbat_flash_read_data(struct us_data *us,
        unsigned char  thistime;
        unsigned int totallen, alloclen;
        int len, result;
-       unsigned int sg_idx = 0, sg_offset = 0;
+       unsigned int sg_offset = 0;
+       struct scatterlist *sg = NULL;
 
        result = usbat_flash_check_media(us, info);
        if (result != USB_STOR_TRANSPORT_GOOD)
@@ -1051,7 +1048,7 @@ static int usbat_flash_read_data(struct us_data *us,
        
                /* Store the data in the transfer buffer */
                usb_stor_access_xfer_buf(buffer, len, us->srb,
-                                        &sg_idx, &sg_offset, TO_XFER_BUF);
+                                        &sg, &sg_offset, TO_XFER_BUF);
 
                sector += thistime;
                totallen -= len;
@@ -1087,7 +1084,8 @@ static int usbat_flash_write_data(struct us_data *us,
        unsigned char  thistime;
        unsigned int totallen, alloclen;
        int len, result;
-       unsigned int sg_idx = 0, sg_offset = 0;
+       unsigned int sg_offset = 0;
+       struct scatterlist *sg = NULL;
 
        result = usbat_flash_check_media(us, info);
        if (result != USB_STOR_TRANSPORT_GOOD)
@@ -1126,7 +1124,7 @@ static int usbat_flash_write_data(struct us_data *us,
 
                /* Get the data from the transfer buffer */
                usb_stor_access_xfer_buf(buffer, len, us->srb,
-                                        &sg_idx, &sg_offset, FROM_XFER_BUF);
+                                        &sg, &sg_offset, FROM_XFER_BUF);
 
                /* ATA command 0x30 (WRITE SECTORS) */
                usbat_pack_ata_sector_cmd(command, thistime, sector, 0x30);
@@ -1166,8 +1164,8 @@ static int usbat_hp8200e_handle_read10(struct us_data *us,
        unsigned char *buffer;
        unsigned int len;
        unsigned int sector;
-       unsigned int sg_segment = 0;
        unsigned int sg_offset = 0;
+       struct scatterlist *sg = NULL;
 
        US_DEBUGP("handle_read10: transfersize %d\n",
                srb->transfersize);
@@ -1224,9 +1222,6 @@ static int usbat_hp8200e_handle_read10(struct us_data *us,
        sector |= short_pack(data[7+5], data[7+4]);
        transferred = 0;
 
-       sg_segment = 0; /* for keeping track of where we are in */
-       sg_offset = 0;  /* the scatter/gather list */
-
        while (transferred != srb->request_bufflen) {
 
                if (len > srb->request_bufflen - transferred)
@@ -1259,7 +1254,7 @@ static int usbat_hp8200e_handle_read10(struct us_data *us,
 
                /* Store the data in the transfer buffer */
                usb_stor_access_xfer_buf(buffer, len, srb,
-                                &sg_segment, &sg_offset, TO_XFER_BUF);
+                                &sg, &sg_offset, TO_XFER_BUF);
 
                /* Update the amount transferred and the sector number */