From: Kevin Winchester <kjwinchester@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>, Giuliano Pochini <pochini@shiny.it>,
Jaroslav Kysela <perex@perex.cz>,
linux-kernel@vger.kernel.org,
Kevin Winchester <kjwinchester@gmail.com>
Subject: [patch 1/2] echoaudio semaphore to mutex
Date: Sun, 09 Dec 2007 13:15:10 -0400 [thread overview]
Message-ID: <20071209171601.368743645@gmail.com> (raw)
In-Reply-To: 20071209171509.601451827@gmail.com
[-- Attachment #1: echoaudio-sem-to-mutex.patch --]
[-- Type: text/plain, Size: 3533 bytes --]
Convert the semaphore to a mutex in echoaudio.c
Signed-off-by: Kevin Winchester <kjwinchester@gmail.com>
---
sound/pci/echoaudio/echoaudio.c | 18 +++++++++---------
sound/pci/echoaudio/echoaudio.h | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
Index: v2.6.24-rc4/sound/pci/echoaudio/echoaudio.c
===================================================================
--- v2.6.24-rc4.orig/sound/pci/echoaudio/echoaudio.c
+++ v2.6.24-rc4/sound/pci/echoaudio/echoaudio.c
@@ -378,7 +378,7 @@ static int pcm_digital_in_open(struct sn
DE_ACT(("pcm_digital_in_open\n"));
max_channels = num_digital_busses_in(chip) - substream->number;
- down(&chip->mode_mutex);
+ mutex_lock(&chip->mode_mutex);
if (chip->digital_mode == DIGITAL_MODE_ADAT)
err = pcm_open(substream, max_channels);
else /* If the card has ADAT, subtract the 6 channels
@@ -405,7 +405,7 @@ static int pcm_digital_in_open(struct sn
chip->can_set_rate=0;
din_exit:
- up(&chip->mode_mutex);
+ mutex_unlock(&chip->mode_mutex);
return err;
}
@@ -420,7 +420,7 @@ static int pcm_digital_out_open(struct s
DE_ACT(("pcm_digital_out_open\n"));
max_channels = num_digital_busses_out(chip) - substream->number;
- down(&chip->mode_mutex);
+ mutex_lock(&chip->mode_mutex);
if (chip->digital_mode == DIGITAL_MODE_ADAT)
err = pcm_open(substream, max_channels);
else /* If the card has ADAT, subtract the 6 channels
@@ -447,7 +447,7 @@ static int pcm_digital_out_open(struct s
if (atomic_read(&chip->opencount) > 1 && chip->rate_set)
chip->can_set_rate=0;
dout_exit:
- up(&chip->mode_mutex);
+ mutex_unlock(&chip->mode_mutex);
return err;
}
@@ -1420,7 +1420,7 @@ static int snd_echo_digital_mode_put(str
if (dmode != chip->digital_mode) {
/* mode_mutex is required to make this operation atomic wrt
pcm_digital_*_open() and set_input_clock() functions. */
- down(&chip->mode_mutex);
+ mutex_lock(&chip->mode_mutex);
/* Do not allow the user to change the digital mode when a pcm
device is open because it also changes the number of channels
@@ -1439,7 +1439,7 @@ static int snd_echo_digital_mode_put(str
if (changed >= 0)
changed = 1; /* No errors */
}
- up(&chip->mode_mutex);
+ mutex_unlock(&chip->mode_mutex);
}
return changed;
}
@@ -1566,12 +1566,12 @@ static int snd_echo_clock_source_put(str
return -EINVAL;
dclock = chip->clock_source_list[eclock];
if (chip->input_clock != dclock) {
- down(&chip->mode_mutex);
+ mutex_lock(&chip->mode_mutex);
spin_lock_irq(&chip->lock);
if ((changed = set_input_clock(chip, dclock)) == 0)
changed = 1; /* no errors */
spin_unlock_irq(&chip->lock);
- up(&chip->mode_mutex);
+ mutex_unlock(&chip->mode_mutex);
}
if (changed < 0)
@@ -1972,7 +1972,7 @@ static __devinit int snd_echo_create(str
return err;
}
atomic_set(&chip->opencount, 0);
- init_MUTEX(&chip->mode_mutex);
+ mutex_init(&chip->mode_mutex);
chip->can_set_rate = 1;
*rchip = chip;
/* Init done ! */
Index: v2.6.24-rc4/sound/pci/echoaudio/echoaudio.h
===================================================================
--- v2.6.24-rc4.orig/sound/pci/echoaudio/echoaudio.h
+++ v2.6.24-rc4/sound/pci/echoaudio/echoaudio.h
@@ -361,7 +361,7 @@ struct echoaudio {
spinlock_t lock;
struct snd_pcm_substream *substream[DSP_MAXPIPES];
int last_period[DSP_MAXPIPES];
- struct semaphore mode_mutex;
+ struct mutex mode_mutex;
u16 num_digital_modes, digital_mode_list[6];
u16 num_clock_sources, clock_source_list[10];
atomic_t opencount;
--
next parent reply other threads:[~2007-12-09 17:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20071209171509.601451827@gmail.com>
2007-12-09 17:15 ` Kevin Winchester [this message]
2007-12-10 9:06 ` [patch 1/2] echoaudio semaphore to mutex Giuliano Pochini
2007-12-17 10:15 ` Takashi Iwai
2007-12-09 17:15 ` [patch 2/2] 9p util " Kevin Winchester
2007-12-12 2:06 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071209171601.368743645@gmail.com \
--to=kjwinchester@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=perex@perex.cz \
--cc=pochini@shiny.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.