Commit b86101e7 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Takashi Iwai <tiwai@suse.de>

PCM Midlevel
removed the export of snd_pcm_lock().  replaced with the normal mutex.
parent 132b0c2c
...@@ -461,8 +461,6 @@ typedef struct _snd_pcm_notify { ...@@ -461,8 +461,6 @@ typedef struct _snd_pcm_notify {
extern snd_pcm_t *snd_pcm_devices[]; extern snd_pcm_t *snd_pcm_devices[];
extern snd_minor_t snd_pcm_reg[2]; extern snd_minor_t snd_pcm_reg[2];
void snd_pcm_lock(int unlock);
int snd_pcm_new(snd_card_t * card, char *id, int device, int snd_pcm_new(snd_card_t * card, char *id, int device,
int playback_count, int capture_count, int playback_count, int capture_count,
snd_pcm_t **rpcm); snd_pcm_t **rpcm);
......
...@@ -43,15 +43,6 @@ static int snd_pcm_dev_register(snd_device_t *device); ...@@ -43,15 +43,6 @@ static int snd_pcm_dev_register(snd_device_t *device);
static int snd_pcm_dev_disconnect(snd_device_t *device); static int snd_pcm_dev_disconnect(snd_device_t *device);
static int snd_pcm_dev_unregister(snd_device_t *device); static int snd_pcm_dev_unregister(snd_device_t *device);
void snd_pcm_lock(int xup)
{
if (!xup) {
down(&register_mutex);
} else {
up(&register_mutex);
}
}
static int snd_pcm_control_ioctl(snd_card_t * card, static int snd_pcm_control_ioctl(snd_card_t * card,
snd_ctl_file_t * control, snd_ctl_file_t * control,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
...@@ -836,10 +827,10 @@ static int snd_pcm_dev_register(snd_device_t *device) ...@@ -836,10 +827,10 @@ static int snd_pcm_dev_register(snd_device_t *device)
snd_pcm_t *pcm = snd_magic_cast(snd_pcm_t, device->device_data, return -ENXIO); snd_pcm_t *pcm = snd_magic_cast(snd_pcm_t, device->device_data, return -ENXIO);
snd_assert(pcm != NULL && device != NULL, return -ENXIO); snd_assert(pcm != NULL && device != NULL, return -ENXIO);
snd_pcm_lock(0); down(&register_mutex);
idx = (pcm->card->number * SNDRV_PCM_DEVICES) + pcm->device; idx = (pcm->card->number * SNDRV_PCM_DEVICES) + pcm->device;
if (snd_pcm_devices[idx]) { if (snd_pcm_devices[idx]) {
snd_pcm_lock(1); up(&register_mutex);
return -EBUSY; return -EBUSY;
} }
snd_pcm_devices[idx] = pcm; snd_pcm_devices[idx] = pcm;
...@@ -861,7 +852,7 @@ static int snd_pcm_dev_register(snd_device_t *device) ...@@ -861,7 +852,7 @@ static int snd_pcm_dev_register(snd_device_t *device)
} }
if ((err = snd_register_device(devtype, pcm->card, pcm->device, pcm->streams[cidx].reg, str)) < 0) { if ((err = snd_register_device(devtype, pcm->card, pcm->device, pcm->streams[cidx].reg, str)) < 0) {
snd_pcm_devices[idx] = NULL; snd_pcm_devices[idx] = NULL;
snd_pcm_lock(1); up(&register_mutex);
return err; return err;
} }
for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) for (substream = pcm->streams[cidx].substream; substream; substream = substream->next)
...@@ -872,7 +863,7 @@ static int snd_pcm_dev_register(snd_device_t *device) ...@@ -872,7 +863,7 @@ static int snd_pcm_dev_register(snd_device_t *device)
notify = list_entry(list, snd_pcm_notify_t, list); notify = list_entry(list, snd_pcm_notify_t, list);
notify->n_register(pcm); notify->n_register(pcm);
} }
snd_pcm_lock(1); up(&register_mutex);
return 0; return 0;
} }
...@@ -882,7 +873,7 @@ static int snd_pcm_dev_disconnect(snd_device_t *device) ...@@ -882,7 +873,7 @@ static int snd_pcm_dev_disconnect(snd_device_t *device)
struct list_head *list; struct list_head *list;
int idx; int idx;
snd_pcm_lock(0); down(&register_mutex);
idx = (pcm->card->number * SNDRV_PCM_DEVICES) + pcm->device; idx = (pcm->card->number * SNDRV_PCM_DEVICES) + pcm->device;
snd_pcm_devices[idx] = NULL; snd_pcm_devices[idx] = NULL;
list_for_each(list, &snd_pcm_notify_list) { list_for_each(list, &snd_pcm_notify_list) {
...@@ -890,7 +881,7 @@ static int snd_pcm_dev_disconnect(snd_device_t *device) ...@@ -890,7 +881,7 @@ static int snd_pcm_dev_disconnect(snd_device_t *device)
notify = list_entry(list, snd_pcm_notify_t, list); notify = list_entry(list, snd_pcm_notify_t, list);
notify->n_disconnect(pcm); notify->n_disconnect(pcm);
} }
snd_pcm_lock(1); up(&register_mutex);
return 0; return 0;
} }
...@@ -902,7 +893,7 @@ static int snd_pcm_dev_unregister(snd_device_t *device) ...@@ -902,7 +893,7 @@ static int snd_pcm_dev_unregister(snd_device_t *device)
snd_pcm_t *pcm = snd_magic_cast(snd_pcm_t, device->device_data, return -ENXIO); snd_pcm_t *pcm = snd_magic_cast(snd_pcm_t, device->device_data, return -ENXIO);
snd_assert(pcm != NULL, return -ENXIO); snd_assert(pcm != NULL, return -ENXIO);
snd_pcm_lock(0); down(&register_mutex);
idx = (pcm->card->number * SNDRV_PCM_DEVICES) + pcm->device; idx = (pcm->card->number * SNDRV_PCM_DEVICES) + pcm->device;
snd_pcm_devices[idx] = NULL; snd_pcm_devices[idx] = NULL;
for (cidx = 0; cidx < 2; cidx++) { for (cidx = 0; cidx < 2; cidx++) {
...@@ -924,7 +915,7 @@ static int snd_pcm_dev_unregister(snd_device_t *device) ...@@ -924,7 +915,7 @@ static int snd_pcm_dev_unregister(snd_device_t *device)
notify = list_entry(list, snd_pcm_notify_t, list); notify = list_entry(list, snd_pcm_notify_t, list);
notify->n_unregister(pcm); notify->n_unregister(pcm);
} }
snd_pcm_lock(1); up(&register_mutex);
return snd_pcm_free(pcm); return snd_pcm_free(pcm);
} }
...@@ -933,7 +924,7 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree) ...@@ -933,7 +924,7 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree)
int idx; int idx;
snd_assert(notify != NULL && notify->n_register != NULL && notify->n_unregister != NULL, return -EINVAL); snd_assert(notify != NULL && notify->n_register != NULL && notify->n_unregister != NULL, return -EINVAL);
snd_pcm_lock(0); down(&register_mutex);
if (nfree) { if (nfree) {
list_del(&notify->list); list_del(&notify->list);
for (idx = 0; idx < SNDRV_CARDS * SNDRV_PCM_DEVICES; idx++) { for (idx = 0; idx < SNDRV_CARDS * SNDRV_PCM_DEVICES; idx++) {
...@@ -949,7 +940,7 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree) ...@@ -949,7 +940,7 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree)
notify->n_register(snd_pcm_devices[idx]); notify->n_register(snd_pcm_devices[idx]);
} }
} }
snd_pcm_lock(1); up(&register_mutex);
return 0; return 0;
} }
...@@ -1014,7 +1005,6 @@ static void __exit alsa_pcm_exit(void) ...@@ -1014,7 +1005,6 @@ static void __exit alsa_pcm_exit(void)
module_init(alsa_pcm_init) module_init(alsa_pcm_init)
module_exit(alsa_pcm_exit) module_exit(alsa_pcm_exit)
EXPORT_SYMBOL(snd_pcm_lock);
EXPORT_SYMBOL(snd_pcm_devices); EXPORT_SYMBOL(snd_pcm_devices);
EXPORT_SYMBOL(snd_pcm_new); EXPORT_SYMBOL(snd_pcm_new);
EXPORT_SYMBOL(snd_pcm_new_stream); EXPORT_SYMBOL(snd_pcm_new_stream);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment