From 7b6d92451ad5e1136dc347347e888b94638b8ba9 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 12 Dec 2005 09:33:37 +0100 Subject: [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 --- sound/synth/emux/emux_seq.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'sound/synth') 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); static void snd_emux_init_port(struct snd_emux_port *p); static int snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info); static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info); -static int get_client(struct snd_card *card, int index, char *name); /* * MIDI emulation operators @@ -71,8 +70,8 @@ snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index) struct snd_seq_port_callback pinfo; char tmpname[64]; - sprintf(tmpname, "%s WaveTable", emu->name); - emu->client = get_client(card, index, tmpname); + emu->client = snd_seq_create_kernel_client(card, index, + "%s WaveTable", emu->name); if (emu->client < 0) { snd_printk("can't create client\n"); return -ENODEV; @@ -341,30 +340,6 @@ snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info) } -/* - * Create a sequencer client - */ -static int -get_client(struct snd_card *card, int index, char *name) -{ - struct snd_seq_client_info cinfo; - int client; - - /* Find a free client, start from 1 as the MPU expects to use 0 */ - client = snd_seq_create_kernel_client(card, index); - if (client < 0) - return client; - - memset(&cinfo, 0, sizeof(cinfo)); - cinfo.client = client; - cinfo.type = KERNEL_CLIENT; - strcpy(cinfo.name, name); - snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo); - - return client; -} - - /* * attach virtual rawmidi devices */ -- cgit v1.2.3