]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/pdc_adma.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[linux-2.6-omap-h63xx.git] / drivers / scsi / pdc_adma.c
index 665017eda8a6596754b7f69bb6d6565597e3172f..78b4ff117af65b1229875d94257a9566ba79ad5c 100644 (file)
@@ -41,7 +41,6 @@
 #include <linux/interrupt.h>
 #include <linux/sched.h>
 #include <linux/device.h>
-#include "scsi.h"
 #include <scsi/scsi_host.h>
 #include <asm/io.h>
 #include <linux/libata.h>
@@ -139,7 +138,7 @@ static u8 adma_bmdma_status(struct ata_port *ap);
 static void adma_irq_clear(struct ata_port *ap);
 static void adma_eng_timeout(struct ata_port *ap);
 
-static Scsi_Host_Template adma_ata_sht = {
+static struct scsi_host_template adma_ata_sht = {
        .module                 = THIS_MODULE,
        .name                   = DRV_NAME,
        .ioctl                  = ata_scsi_ioctl,
@@ -293,14 +292,14 @@ static void adma_eng_timeout(struct ata_port *ap)
 
 static int adma_fill_sg(struct ata_queued_cmd *qc)
 {
-       struct scatterlist *sg = qc->sg;
+       struct scatterlist *sg;
        struct ata_port *ap = qc->ap;
        struct adma_port_priv *pp = ap->private_data;
        u8  *buf = pp->pkt;
-       int nelem, i = (2 + buf[3]) * 8;
+       int i = (2 + buf[3]) * 8;
        u8 pFLAGS = pORD | ((qc->tf.flags & ATA_TFLAG_WRITE) ? pDIRO : 0);
 
-       for (nelem = 0; nelem < qc->n_elem; nelem++,sg++) {
+       ata_for_each_sg(sg, qc) {
                u32 addr;
                u32 len;
 
@@ -312,7 +311,7 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
                *(__le32 *)(buf + i) = cpu_to_le32(len);
                i += 4;
 
-               if ((nelem + 1) == qc->n_elem)
+               if (ata_sg_is_last(sg, qc))
                        pFLAGS |= pEND;
                buf[i++] = pFLAGS;
                buf[i++] = qc->dev->dma_mode & 0xf;