]> err.no Git - linux-2.6/blobdiff - drivers/ieee1394/sbp2.c
[PATCH] kexec: fix sparse warnings
[linux-2.6] / drivers / ieee1394 / sbp2.c
index 094e646ed4de2dc5d717c47e9e15f90486f85889..32368f3428ecfb3a425a3536e6432779e91fe619 100644 (file)
@@ -745,7 +745,8 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud
        list_add_tail(&scsi_id->scsi_list, &hi->scsi_ids);
 
        /* Register our host with the SCSI stack. */
-       scsi_host = scsi_host_alloc(&scsi_driver_template, 0);
+       scsi_host = scsi_host_alloc(&scsi_driver_template,
+                                   sizeof (unsigned long));
        if (!scsi_host) {
                SBP2_ERR("failed to register scsi host");
                goto failed_alloc;
@@ -2151,7 +2152,6 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
                                     struct scsi_cmnd *SCpnt)
 {
        u8 *scsi_buf = SCpnt->request_buffer;
-       u8 device_type = SBP2_DEVICE_TYPE (scsi_id->sbp2_device_type_and_lun);
 
        SBP2_DEBUG("sbp2_check_sbp2_response");
 
@@ -2454,8 +2454,6 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id,
                                      u32 scsi_status, struct scsi_cmnd *SCpnt,
                                      void (*done)(struct scsi_cmnd *))
 {
-       unsigned long flags;
-
        SBP2_DEBUG("sbp2scsi_complete_command");
 
        /*
@@ -2554,11 +2552,7 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id,
        /*
         * Tell scsi stack that we're done with this command
         */
-       spin_lock_irqsave(scsi_id->scsi_host->host_lock,flags);
        done (SCpnt);
-       spin_unlock_irqrestore(scsi_id->scsi_host->host_lock,flags);
-
-       return;
 }
 
 
@@ -2622,7 +2616,7 @@ static int sbp2scsi_abort(struct scsi_cmnd *SCpnt)
 /*
  * Called by scsi stack when something has really gone wrong.
  */
-static int sbp2scsi_reset(struct scsi_cmnd *SCpnt)
+static int __sbp2scsi_reset(struct scsi_cmnd *SCpnt)
 {
        struct scsi_id_instance_data *scsi_id =
                (struct scsi_id_instance_data *)SCpnt->device->host->hostdata[0];
@@ -2637,12 +2631,24 @@ static int sbp2scsi_reset(struct scsi_cmnd *SCpnt)
        return(SUCCESS);
 }
 
+static int sbp2scsi_reset(struct scsi_cmnd *SCpnt)
+{
+       unsigned long flags;
+       int rc;
+
+       spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
+       rc = __sbp2scsi_reset(SCpnt);
+       spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
+
+       return rc;
+}
+
 static const char *sbp2scsi_info (struct Scsi_Host *host)
 {
         return "SCSI emulation for IEEE-1394 SBP-2 Devices";
 }
 
-static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev, char *buf)
+static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
        struct scsi_device *sdev;
        struct scsi_id_instance_data *scsi_id;