aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-03-23 06:00:22 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 10:38:10 -0500
commite723ccd805857a46d3b63fbd20edea8579c6c541 (patch)
tree00ea3941543aad06172f5f16c78cfed2f4afb2e3
parent8ed965d612d9e9bc08805c75123f063cf6966311 (diff)
[PATCH] sem2mutex: drivers/scsi/ide-scsi.c
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Jens Axboe <axboe@suse.de> Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/scsi/ide-scsi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 0cf0e4c7ac0c..39b760a24241 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -47,6 +47,7 @@
47#include <linux/ide.h> 47#include <linux/ide.h>
48#include <linux/scatterlist.h> 48#include <linux/scatterlist.h>
49#include <linux/delay.h> 49#include <linux/delay.h>
50#include <linux/mutex.h>
50 51
51#include <asm/io.h> 52#include <asm/io.h>
52#include <asm/bitops.h> 53#include <asm/bitops.h>
@@ -109,7 +110,7 @@ typedef struct ide_scsi_obj {
109 unsigned long log; /* log flags */ 110 unsigned long log; /* log flags */
110} idescsi_scsi_t; 111} idescsi_scsi_t;
111 112
112static DECLARE_MUTEX(idescsi_ref_sem); 113static DEFINE_MUTEX(idescsi_ref_mutex);
113 114
114#define ide_scsi_g(disk) \ 115#define ide_scsi_g(disk) \
115 container_of((disk)->private_data, struct ide_scsi_obj, driver) 116 container_of((disk)->private_data, struct ide_scsi_obj, driver)
@@ -118,19 +119,19 @@ static struct ide_scsi_obj *ide_scsi_get(struct gendisk *disk)
118{ 119{
119 struct ide_scsi_obj *scsi = NULL; 120 struct ide_scsi_obj *scsi = NULL;
120 121
121 down(&idescsi_ref_sem); 122 mutex_lock(&idescsi_ref_mutex);
122 scsi = ide_scsi_g(disk); 123 scsi = ide_scsi_g(disk);
123 if (scsi) 124 if (scsi)
124 scsi_host_get(scsi->host); 125 scsi_host_get(scsi->host);
125 up(&idescsi_ref_sem); 126 mutex_unlock(&idescsi_ref_mutex);
126 return scsi; 127 return scsi;
127} 128}
128 129
129static void ide_scsi_put(struct ide_scsi_obj *scsi) 130static void ide_scsi_put(struct ide_scsi_obj *scsi)
130{ 131{
131 down(&idescsi_ref_sem); 132 mutex_lock(&idescsi_ref_mutex);
132 scsi_host_put(scsi->host); 133 scsi_host_put(scsi->host);
133 up(&idescsi_ref_sem); 134 mutex_unlock(&idescsi_ref_mutex);
134} 135}
135 136
136static inline idescsi_scsi_t *scsihost_to_idescsi(struct Scsi_Host *host) 137static inline idescsi_scsi_t *scsihost_to_idescsi(struct Scsi_Host *host)