]> err.no Git - linux-2.6/blobdiff - drivers/scsi/qlogicfc.c
Merge branch 'master'
[linux-2.6] / drivers / scsi / qlogicfc.c
index ddf0f4277ee8cd087b24b007afb07adcb1b085c3..52b224a5d6fd678e8ec1c988d57fea0ff4c890b8 100644 (file)
@@ -61,6 +61,8 @@
 #include <linux/unistd.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
+#include <linux/dma-mapping.h>
+#include <linux/jiffies.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include "scsi.h"
@@ -711,7 +713,7 @@ static inline void isp2x00_disable_irqs(struct Scsi_Host *host)
 }
 
 
-static int isp2x00_detect(Scsi_Host_Template * tmpt)
+static int isp2x00_detect(struct scsi_host_template * tmpt)
 {
        int hosts = 0;
        unsigned long wait_time;
@@ -737,8 +739,8 @@ static int isp2x00_detect(Scsi_Host_Template * tmpt)
                                continue;
 
                        /* Try to configure DMA attributes. */
-                       if (pci_set_dma_mask(pdev, 0xffffffffffffffffULL) &&
-                           pci_set_dma_mask(pdev, 0xffffffffULL))
+                       if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) &&
+                           pci_set_dma_mask(pdev, DMA_32BIT_MASK))
                                        continue;
 
                        host = scsi_register(tmpt, sizeof(struct isp2x00_hostdata));
@@ -746,7 +748,6 @@ static int isp2x00_detect(Scsi_Host_Template * tmpt)
                                printk("qlogicfc%d : could not register host.\n", hosts);
                                continue;
                        }
-                       scsi_set_device(host, &pdev->dev);
                        host->max_id = QLOGICFC_MAX_ID + 1;
                        host->max_lun = QLOGICFC_MAX_LUN;
                        hostdata = (struct isp2x00_hostdata *) host->hostdata;
@@ -1326,7 +1327,7 @@ static int isp2x00_queuecommand(Scsi_Cmnd * Cmnd, void (*done) (Scsi_Cmnd *))
                cmd->control_flags = cpu_to_le16(CFLAG_READ);
 
        if (Cmnd->device->tagged_supported) {
-               if ((jiffies - hostdata->tag_ages[Cmnd->device->id]) > (2 * ISP_TIMEOUT)) {
+               if (time_after(jiffies, hostdata->tag_ages[Cmnd->device->id] + (2 * ISP_TIMEOUT))) {
                        cmd->control_flags |= cpu_to_le16(CFLAG_ORDERED_TAG);
                        hostdata->tag_ages[Cmnd->device->id] = jiffies;
                } else
@@ -2211,7 +2212,7 @@ void isp2x00_print_scsi_cmd(Scsi_Cmnd * cmd)
 
 MODULE_LICENSE("GPL");
 
-static Scsi_Host_Template driver_template = {
+static struct scsi_host_template driver_template = {
         .detect                 = isp2x00_detect,
         .release                = isp2x00_release,
         .info                   = isp2x00_info,