|
@@ -267,8 +267,8 @@ snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private_data,
|
|
|
/*
|
|
|
* increment usage count
|
|
|
*/
|
|
|
-int
|
|
|
-snd_emux_inc_count(struct snd_emux *emu)
|
|
|
+static int
|
|
|
+__snd_emux_inc_count(struct snd_emux *emu)
|
|
|
{
|
|
|
emu->used++;
|
|
|
if (!try_module_get(emu->ops.owner))
|
|
@@ -282,12 +282,21 @@ snd_emux_inc_count(struct snd_emux *emu)
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+int snd_emux_inc_count(struct snd_emux *emu)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ mutex_lock(&emu->register_mutex);
|
|
|
+ ret = __snd_emux_inc_count(emu);
|
|
|
+ mutex_unlock(&emu->register_mutex);
|
|
|
+ return ret;
|
|
|
+}
|
|
|
|
|
|
/*
|
|
|
* decrease usage count
|
|
|
*/
|
|
|
-void
|
|
|
-snd_emux_dec_count(struct snd_emux *emu)
|
|
|
+static void
|
|
|
+__snd_emux_dec_count(struct snd_emux *emu)
|
|
|
{
|
|
|
module_put(emu->card->module);
|
|
|
emu->used--;
|
|
@@ -296,6 +305,12 @@ snd_emux_dec_count(struct snd_emux *emu)
|
|
|
module_put(emu->ops.owner);
|
|
|
}
|
|
|
|
|
|
+void snd_emux_dec_count(struct snd_emux *emu)
|
|
|
+{
|
|
|
+ mutex_lock(&emu->register_mutex);
|
|
|
+ __snd_emux_dec_count(emu);
|
|
|
+ mutex_unlock(&emu->register_mutex);
|
|
|
+}
|
|
|
|
|
|
/*
|
|
|
* Routine that is called upon a first use of a particular port
|
|
@@ -315,7 +330,7 @@ snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info)
|
|
|
|
|
|
mutex_lock(&emu->register_mutex);
|
|
|
snd_emux_init_port(p);
|
|
|
- snd_emux_inc_count(emu);
|
|
|
+ __snd_emux_inc_count(emu);
|
|
|
mutex_unlock(&emu->register_mutex);
|
|
|
return 0;
|
|
|
}
|
|
@@ -338,7 +353,7 @@ snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info)
|
|
|
|
|
|
mutex_lock(&emu->register_mutex);
|
|
|
snd_emux_sounds_off_all(p);
|
|
|
- snd_emux_dec_count(emu);
|
|
|
+ __snd_emux_dec_count(emu);
|
|
|
mutex_unlock(&emu->register_mutex);
|
|
|
return 0;
|
|
|
}
|