]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/storage/datafab.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / usb / storage / datafab.c
index 54e3e6c7ecd86362781e1ecc7f1e9c9b6f3ff348..17f1ae232919ebc5123e778f6c10d404f7651d49 100644 (file)
@@ -1,6 +1,4 @@
 /* Driver for Datafab USB Compact Flash reader
- *
- * $Id: datafab.c,v 1.7 2002/02/25 00:40:13 mdharm Exp $
  *
  * datafab driver v0.1:
  *
@@ -50,7 +48,6 @@
  * in that routine.
  */
 
-#include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
 
@@ -99,7 +96,8 @@ static int datafab_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;
 
        // we're working in LBA mode.  according to the ATA spec, 
        // we can support up to 28-bit addressing.  I don't know if Datafab
@@ -156,7 +154,7 @@ static int datafab_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;
@@ -182,7 +180,8 @@ static int datafab_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;
 
        // we're working in LBA mode.  according to the ATA spec, 
        // we can support up to 28-bit addressing.  I don't know if Datafab
@@ -218,7 +217,7 @@ static int datafab_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);
 
                command[0] = 0;
                command[1] = thistime;
@@ -512,13 +511,12 @@ int datafab_transport(struct scsi_cmnd * srb, struct us_data *us)
        };
 
        if (!us->extra) {
-               us->extra = kmalloc(sizeof(struct datafab_info), GFP_NOIO);
+               us->extra = kzalloc(sizeof(struct datafab_info), GFP_NOIO);
                if (!us->extra) {
                        US_DEBUGP("datafab_transport:  Gah! "
                                  "Can't allocate storage for Datafab info struct!\n");
                        return USB_STOR_TRANSPORT_ERROR;
                }
-               memset(us->extra, 0, sizeof(struct datafab_info));
                us->extra_destructor = datafab_info_destructor;
                ((struct datafab_info *)us->extra)->lun = -1;
        }