[SCSI] megaraid_sas: Convert aen_mutex to the mutex API
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>
Sat, 27 Oct 2007 07:48:46 +0000 (09:48 +0200)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Sat, 12 Jan 2008 00:22:41 +0000 (18:22 -0600)
Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Acked-by: Bo Yang <Bo.Yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/megaraid/megaraid_sas.c
drivers/scsi/megaraid/megaraid_sas.h

index e3c5c52822030f42283b6c9baa357f1921238336..3ad379fcd18f1069c06de059a6b0775398e5ff56 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/moduleparam.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
+#include <linux/mutex.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/uio.h>
@@ -2358,7 +2359,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
        spin_lock_init(&instance->cmd_pool_lock);
 
-       sema_init(&instance->aen_mutex, 1);
+       mutex_init(&instance->aen_mutex);
        sema_init(&instance->ioctl_sem, MEGASAS_INT_CMDS);
 
        /*
@@ -2874,10 +2875,10 @@ static int megasas_mgmt_ioctl_aen(struct file *file, unsigned long arg)
        if (!instance)
                return -ENODEV;
 
-       down(&instance->aen_mutex);
+       mutex_lock(&instance->aen_mutex);
        error = megasas_register_aen(instance, aen.seq_num,
                                     aen.class_locale_word);
-       up(&instance->aen_mutex);
+       mutex_unlock(&instance->aen_mutex);
        return error;
 }
 
index 4dffc918a414c3bf5c4254f0ceea06998127cc15..08c74c991781cd52dc3898842cc9b98499354685 100644 (file)
@@ -1089,7 +1089,7 @@ struct megasas_instance {
        struct megasas_evt_detail *evt_detail;
        dma_addr_t evt_detail_h;
        struct megasas_cmd *aen_cmd;
-       struct semaphore aen_mutex;
+       struct mutex aen_mutex;
        struct semaphore ioctl_sem;
 
        struct Scsi_Host *host;