lkml.org 
[lkml]   [2008]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 1/2] QLA2xxx: Convert qla_fw_lock in a mutex
QLA2XXX driver: The semaphore qla_fw_lock is used as a mutex. 
Convert it to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>

Index: linux-2.6/drivers/scsi/qla2xxx/qla_os.c
===================================================================
--- linux-2.6.orig/drivers/scsi/qla2xxx/qla_os.c 2008-05-04 20:17:57.000000000 +0200
+++ linux-2.6/drivers/scsi/qla2xxx/qla_os.c 2008-05-04 20:18:04.000000000 +0200
@@ -2640,7 +2640,7 @@
#define FW_FILE_ISP24XX "ql2400_fw.bin"
#define FW_FILE_ISP25XX "ql2500_fw.bin"

-static DECLARE_MUTEX(qla_fw_lock);
+static DEFINE_MUTEX(qla_fw_lock);

static struct fw_blob qla_fw_blobs[FW_BLOBS] = {
{ .name = FW_FILE_ISP21XX, .segs = { 0x1000, 0 }, },
@@ -2671,7 +2671,7 @@
blob = &qla_fw_blobs[FW_ISP25XX];
}

- down(&qla_fw_lock);
+ mutex_lock(&qla_fw_lock);
if (blob->fw)
goto out;

@@ -2684,7 +2684,7 @@
}

out:
- up(&qla_fw_lock);
+ mutex_unlock(&qla_fw_lock);
return blob;
}

@@ -2693,11 +2693,11 @@
{
int idx;

- down(&qla_fw_lock);
+ mutex_lock(&qla_fw_lock);
for (idx = 0; idx < FW_BLOBS; idx++)
if (qla_fw_blobs[idx].fw)
release_firmware(qla_fw_blobs[idx].fw);
- up(&qla_fw_lock);
+ mutex_unlock(&qla_fw_lock);
}

static pci_ers_result_t
--
Matthias Kaehlcke
Embedded Linux Engineer
Barcelona

We build too many walls and not enough bridges
(Isaac Newton)
.''`.
using free software / Debian GNU/Linux | http://debian.org : :' :
`. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4 `-

\
 
 \ /
  Last update: 2008-05-04 21:29    [W:0.039 / U:2.264 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site