diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-12-12 08:33:37 (GMT) |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 11:30:49 (GMT) |
commit | 7b6d92451ad5e1136dc347347e888b94638b8ba9 (patch) | |
tree | e62edf62f29e988378cd2c984cde0ccb0993120b /sound/drivers | |
parent | 83e8ad6984dccd6d848ac91ba0df379ff968180b (diff) | |
download | linux-7b6d92451ad5e1136dc347347e888b94638b8ba9.tar.xz |
[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/drivers')
-rw-r--r-- | sound/drivers/opl3/opl3_seq.c | 17 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_seq.c | 11 |
2 files changed, 8 insertions, 20 deletions
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c index 582ff63..c4ead79 100644 --- a/sound/drivers/opl3/opl3_seq.c +++ b/sound/drivers/opl3/opl3_seq.c @@ -219,7 +219,7 @@ static int snd_opl3_seq_new_device(struct snd_seq_device *dev) { struct snd_opl3 *opl3; int client; - struct snd_seq_client_info cinfo; + char name[32]; int opl_ver; opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev); @@ -231,19 +231,14 @@ static int snd_opl3_seq_new_device(struct snd_seq_device *dev) opl3->seq_client = -1; /* allocate new client */ + opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8; + sprintf(name, "OPL%i FM synth", opl_ver); client = opl3->seq_client = - snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num); + snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num, + name); if (client < 0) return client; - /* change name of client */ - memset(&cinfo, 0, sizeof(cinfo)); - cinfo.client = client; - cinfo.type = KERNEL_CLIENT; - opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8; - sprintf(cinfo.name, "OPL%i FM synth", opl_ver); - snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo); - snd_opl3_synth_create_port(opl3); /* initialize instrument list */ @@ -264,7 +259,7 @@ static int snd_opl3_seq_new_device(struct snd_seq_device *dev) opl3->sys_timer_status = 0; #ifdef CONFIG_SND_SEQUENCER_OSS - snd_opl3_init_seq_oss(opl3, cinfo.name); + snd_opl3_init_seq_oss(opl3, name); #endif return 0; } diff --git a/sound/drivers/opl4/opl4_seq.c b/sound/drivers/opl4/opl4_seq.c index a69117d..e348032 100644 --- a/sound/drivers/opl4/opl4_seq.c +++ b/sound/drivers/opl4/opl4_seq.c @@ -127,7 +127,6 @@ static int snd_opl4_seq_new_device(struct snd_seq_device *dev) { struct snd_opl4 *opl4; int client; - struct snd_seq_client_info cinfo; struct snd_seq_port_callback pcallbacks; opl4 = *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(dev); @@ -143,7 +142,8 @@ static int snd_opl4_seq_new_device(struct snd_seq_device *dev) opl4->chset->private_data = opl4; /* allocate new client */ - client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num); + client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num, + "OPL4 Wavetable"); if (client < 0) { snd_midi_channel_free_set(opl4->chset); return client; @@ -151,13 +151,6 @@ static int snd_opl4_seq_new_device(struct snd_seq_device *dev) opl4->seq_client = client; opl4->chset->client = client; - /* change name of client */ - memset(&cinfo, 0, sizeof(cinfo)); - cinfo.client = client; - cinfo.type = KERNEL_CLIENT; - strcpy(cinfo.name, "OPL4 Wavetable"); - snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo); - /* create new port */ memset(&pcallbacks, 0, sizeof(pcallbacks)); pcallbacks.owner = THIS_MODULE; |