[SCSI] remove target parent limitiation
[powerpc.git] / drivers / scsi / megaraid / megaraid_sas.c
index 4245d05..c0bb806 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/list.h>
-#include <linux/version.h>
 #include <linux/moduleparam.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
@@ -36,6 +35,7 @@
 #include <asm/uaccess.h>
 #include <linux/fs.h>
 #include <linux/compat.h>
+#include <linux/mutex.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
@@ -73,7 +73,7 @@ MODULE_DEVICE_TABLE(pci, megasas_pci_table);
 static int megasas_mgmt_majorno;
 static struct megasas_mgmt_info megasas_mgmt_info;
 static struct fasync_struct *megasas_async_queue;
-static DECLARE_MUTEX(megasas_async_queue_mutex);
+static DEFINE_MUTEX(megasas_async_queue_mutex);
 
 /**
  * megasas_get_cmd -   Get a command from the free pool
@@ -767,17 +767,12 @@ static int megasas_generic_reset(struct scsi_cmnd *scmd)
                return FAILED;
        }
 
-       spin_unlock(scmd->device->host->host_lock);
-
        ret_val = megasas_wait_for_outstanding(instance);
-
        if (ret_val == SUCCESS)
                printk(KERN_NOTICE "megasas: reset successful \n");
        else
                printk(KERN_ERR "megasas: failed to do reset\n");
 
-       spin_lock(scmd->device->host->host_lock);
-
        return ret_val;
 }
 
@@ -2368,11 +2363,11 @@ static int megasas_mgmt_fasync(int fd, struct file *filep, int mode)
 {
        int rc;
 
-       down(&megasas_async_queue_mutex);
+       mutex_lock(&megasas_async_queue_mutex);
 
        rc = fasync_helper(fd, filep, mode, &megasas_async_queue);
 
-       up(&megasas_async_queue_mutex);
+       mutex_unlock(&megasas_async_queue_mutex);
 
        if (rc >= 0) {
                /* For sanity check when we get ioctl */