]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/ncr53c8xx.c
ipw2200: do not byteswap struct ipw_associate
[linux-2.6-omap-h63xx.git] / drivers / scsi / ncr53c8xx.c
index 030ba49f33ff3f4a338da8331456f47a0a9ebcff..c02771aa6c9b4d76d6abc52c509ec9c0327b83f3 100644 (file)
@@ -4963,7 +4963,8 @@ void ncr_complete (struct ncb *np, struct ccb *cp)
                **      Copy back sense data to caller's buffer.
                */
                memcpy(cmd->sense_buffer, cp->sense_buf,
-                      min(sizeof(cmd->sense_buffer), sizeof(cp->sense_buf)));
+                      min_t(size_t, SCSI_SENSE_BUFFERSIZE,
+                            sizeof(cp->sense_buf)));
 
                if (DEBUG_FLAGS & (DEBUG_RESULT|DEBUG_TINY)) {
                        u_char * p = (u_char*) & cmd->sense_buffer;
@@ -8143,12 +8144,7 @@ static int ncr53c8xx_abort(struct scsi_cmnd *cmd)
        unsigned long flags;
        struct scsi_cmnd *done_list;
 
-#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS
-       printk("ncr53c8xx_abort: pid=%lu serial_number=%ld\n",
-               cmd->pid, cmd->serial_number);
-#else
-       printk("ncr53c8xx_abort: command pid %lu\n", cmd->pid);
-#endif
+       printk("ncr53c8xx_abort: command pid %lu\n", cmd->serial_number);
 
        NCR_LOCK_NCB(np, flags);
 
@@ -8528,18 +8524,15 @@ struct Scsi_Host * __init ncr_attach(struct scsi_host_template *tpnt,
 }
 
 
-int ncr53c8xx_release(struct Scsi_Host *host)
+void ncr53c8xx_release(struct Scsi_Host *host)
 {
-       struct host_data *host_data;
+       struct host_data *host_data = shost_priv(host);
 #ifdef DEBUG_NCR53C8XX
        printk("ncr53c8xx: release\n");
 #endif
-       if (!host)
-               return 1;
-       host_data = (struct host_data *)host->hostdata;
-       if (host_data && host_data->ncb)
+       if (host_data->ncb)
                ncr_detach(host_data->ncb);
-       return 1;
+       scsi_host_put(host);
 }
 
 static void ncr53c8xx_set_period(struct scsi_target *starget, int period)