summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2006-03-23 03:00:45 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 07:38:14 -0800
commitcf8b8975c3c35d1269bf6f1c6f2ae4efb6909607 (patch)
tree25063f24381e7762db20ff4062bd43240602c327 /drivers/ide/ide-cd.c
parent81861d78c9edf9a9b03a9ba1f5b242d658f16832 (diff)
downloadlinux-cf8b8975c3c35d1269bf6f1c6f2ae4efb6909607.tar.gz
linux-cf8b8975c3c35d1269bf6f1c6f2ae4efb6909607.tar.bz2
linux-cf8b8975c3c35d1269bf6f1c6f2ae4efb6909607.zip
[PATCH] sem2mutex: drivers/ide
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r--drivers/ide/ide-cd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 430d8af35cb1..c7671e188017 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -313,6 +313,7 @@
#include <linux/cdrom.h>
#include <linux/ide.h>
#include <linux/completion.h>
+#include <linux/mutex.h>
#include <scsi/scsi.h> /* For SCSI -> ATAPI command conversion */
@@ -324,7 +325,7 @@
#include "ide-cd.h"
-static DECLARE_MUTEX(idecd_ref_sem);
+static DEFINE_MUTEX(idecd_ref_mutex);
#define to_ide_cd(obj) container_of(obj, struct cdrom_info, kref)
@@ -335,11 +336,11 @@ static struct cdrom_info *ide_cd_get(struct gendisk *disk)
{
struct cdrom_info *cd = NULL;
- down(&idecd_ref_sem);
+ mutex_lock(&idecd_ref_mutex);
cd = ide_cd_g(disk);
if (cd)
kref_get(&cd->kref);
- up(&idecd_ref_sem);
+ mutex_unlock(&idecd_ref_mutex);
return cd;
}
@@ -347,9 +348,9 @@ static void ide_cd_release(struct kref *);
static void ide_cd_put(struct cdrom_info *cd)
{
- down(&idecd_ref_sem);
+ mutex_lock(&idecd_ref_mutex);
kref_put(&cd->kref, ide_cd_release);
- up(&idecd_ref_sem);
+ mutex_unlock(&idecd_ref_mutex);
}
/****************************************************************************