diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-03-23 06:00:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 10:38:14 -0500 |
commit | cf8b8975c3c35d1269bf6f1c6f2ae4efb6909607 (patch) | |
tree | 25063f24381e7762db20ff4062bd43240602c327 /drivers/ide/ide-cd.c | |
parent | 81861d78c9edf9a9b03a9ba1f5b242d658f16832 (diff) |
[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.c | 11 |
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 @@ | |||
313 | #include <linux/cdrom.h> | 313 | #include <linux/cdrom.h> |
314 | #include <linux/ide.h> | 314 | #include <linux/ide.h> |
315 | #include <linux/completion.h> | 315 | #include <linux/completion.h> |
316 | #include <linux/mutex.h> | ||
316 | 317 | ||
317 | #include <scsi/scsi.h> /* For SCSI -> ATAPI command conversion */ | 318 | #include <scsi/scsi.h> /* For SCSI -> ATAPI command conversion */ |
318 | 319 | ||
@@ -324,7 +325,7 @@ | |||
324 | 325 | ||
325 | #include "ide-cd.h" | 326 | #include "ide-cd.h" |
326 | 327 | ||
327 | static DECLARE_MUTEX(idecd_ref_sem); | 328 | static DEFINE_MUTEX(idecd_ref_mutex); |
328 | 329 | ||
329 | #define to_ide_cd(obj) container_of(obj, struct cdrom_info, kref) | 330 | #define to_ide_cd(obj) container_of(obj, struct cdrom_info, kref) |
330 | 331 | ||
@@ -335,11 +336,11 @@ static struct cdrom_info *ide_cd_get(struct gendisk *disk) | |||
335 | { | 336 | { |
336 | struct cdrom_info *cd = NULL; | 337 | struct cdrom_info *cd = NULL; |
337 | 338 | ||
338 | down(&idecd_ref_sem); | 339 | mutex_lock(&idecd_ref_mutex); |
339 | cd = ide_cd_g(disk); | 340 | cd = ide_cd_g(disk); |
340 | if (cd) | 341 | if (cd) |
341 | kref_get(&cd->kref); | 342 | kref_get(&cd->kref); |
342 | up(&idecd_ref_sem); | 343 | mutex_unlock(&idecd_ref_mutex); |
343 | return cd; | 344 | return cd; |
344 | } | 345 | } |
345 | 346 | ||
@@ -347,9 +348,9 @@ static void ide_cd_release(struct kref *); | |||
347 | 348 | ||
348 | static void ide_cd_put(struct cdrom_info *cd) | 349 | static void ide_cd_put(struct cdrom_info *cd) |
349 | { | 350 | { |
350 | down(&idecd_ref_sem); | 351 | mutex_lock(&idecd_ref_mutex); |
351 | kref_put(&cd->kref, ide_cd_release); | 352 | kref_put(&cd->kref, ide_cd_release); |
352 | up(&idecd_ref_sem); | 353 | mutex_unlock(&idecd_ref_mutex); |
353 | } | 354 | } |
354 | 355 | ||
355 | /**************************************************************************** | 356 | /**************************************************************************** |