aboutsummaryrefslogtreecommitdiffstats
path: root/sound/synth/emux/emux_seq.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-12-12 03:33:37 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:30:49 -0500
commit7b6d92451ad5e1136dc347347e888b94638b8ba9 (patch)
treee62edf62f29e988378cd2c984cde0ccb0993120b /sound/synth/emux/emux_seq.c
parent83e8ad6984dccd6d848ac91ba0df379ff968180b (diff)
[ALSA] seq: set client name in snd_seq_create_kernel_client()
All users of snd_seq_create_kernel_client() have to set the client name anyway, so we can just pass the name as parameter. This relieves us from having to muck around with a struct snd_seq_client_info in these cases. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/synth/emux/emux_seq.c')
-rw-r--r--sound/synth/emux/emux_seq.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
index b7129c5aee06..1a973d7a90f8 100644
--- a/sound/synth/emux/emux_seq.c
+++ b/sound/synth/emux/emux_seq.c
@@ -28,7 +28,6 @@ static void free_port(void *private);
28static void snd_emux_init_port(struct snd_emux_port *p); 28static void snd_emux_init_port(struct snd_emux_port *p);
29static int snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info); 29static int snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info);
30static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info); 30static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info);
31static int get_client(struct snd_card *card, int index, char *name);
32 31
33/* 32/*
34 * MIDI emulation operators 33 * MIDI emulation operators
@@ -71,8 +70,8 @@ snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index)
71 struct snd_seq_port_callback pinfo; 70 struct snd_seq_port_callback pinfo;
72 char tmpname[64]; 71 char tmpname[64];
73 72
74 sprintf(tmpname, "%s WaveTable", emu->name); 73 emu->client = snd_seq_create_kernel_client(card, index,
75 emu->client = get_client(card, index, tmpname); 74 "%s WaveTable", emu->name);
76 if (emu->client < 0) { 75 if (emu->client < 0) {
77 snd_printk("can't create client\n"); 76 snd_printk("can't create client\n");
78 return -ENODEV; 77 return -ENODEV;
@@ -342,30 +341,6 @@ snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info)
342 341
343 342
344/* 343/*
345 * Create a sequencer client
346 */
347static int
348get_client(struct snd_card *card, int index, char *name)
349{
350 struct snd_seq_client_info cinfo;
351 int client;
352
353 /* Find a free client, start from 1 as the MPU expects to use 0 */
354 client = snd_seq_create_kernel_client(card, index);
355 if (client < 0)
356 return client;
357
358 memset(&cinfo, 0, sizeof(cinfo));
359 cinfo.client = client;
360 cinfo.type = KERNEL_CLIENT;
361 strcpy(cinfo.name, name);
362 snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo);
363
364 return client;
365}
366
367
368/*
369 * attach virtual rawmidi devices 344 * attach virtual rawmidi devices
370 */ 345 */
371int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card) 346int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card)