aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers
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/drivers
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/drivers')
-rw-r--r--sound/drivers/opl3/opl3_seq.c17
-rw-r--r--sound/drivers/opl4/opl4_seq.c11
2 files changed, 8 insertions, 20 deletions
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c
index 582ff63e784b..c4ead790008a 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)
219{ 219{
220 struct snd_opl3 *opl3; 220 struct snd_opl3 *opl3;
221 int client; 221 int client;
222 struct snd_seq_client_info cinfo; 222 char name[32];
223 int opl_ver; 223 int opl_ver;
224 224
225 opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev); 225 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)
231 opl3->seq_client = -1; 231 opl3->seq_client = -1;
232 232
233 /* allocate new client */ 233 /* allocate new client */
234 opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8;
235 sprintf(name, "OPL%i FM synth", opl_ver);
234 client = opl3->seq_client = 236 client = opl3->seq_client =
235 snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num); 237 snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num,
238 name);
236 if (client < 0) 239 if (client < 0)
237 return client; 240 return client;
238 241
239 /* change name of client */
240 memset(&cinfo, 0, sizeof(cinfo));
241 cinfo.client = client;
242 cinfo.type = KERNEL_CLIENT;
243 opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8;
244 sprintf(cinfo.name, "OPL%i FM synth", opl_ver);
245 snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo);
246
247 snd_opl3_synth_create_port(opl3); 242 snd_opl3_synth_create_port(opl3);
248 243
249 /* initialize instrument list */ 244 /* initialize instrument list */
@@ -264,7 +259,7 @@ static int snd_opl3_seq_new_device(struct snd_seq_device *dev)
264 opl3->sys_timer_status = 0; 259 opl3->sys_timer_status = 0;
265 260
266#ifdef CONFIG_SND_SEQUENCER_OSS 261#ifdef CONFIG_SND_SEQUENCER_OSS
267 snd_opl3_init_seq_oss(opl3, cinfo.name); 262 snd_opl3_init_seq_oss(opl3, name);
268#endif 263#endif
269 return 0; 264 return 0;
270} 265}
diff --git a/sound/drivers/opl4/opl4_seq.c b/sound/drivers/opl4/opl4_seq.c
index a69117dd0071..e3480326e735 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)
127{ 127{
128 struct snd_opl4 *opl4; 128 struct snd_opl4 *opl4;
129 int client; 129 int client;
130 struct snd_seq_client_info cinfo;
131 struct snd_seq_port_callback pcallbacks; 130 struct snd_seq_port_callback pcallbacks;
132 131
133 opl4 = *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(dev); 132 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)
143 opl4->chset->private_data = opl4; 142 opl4->chset->private_data = opl4;
144 143
145 /* allocate new client */ 144 /* allocate new client */
146 client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num); 145 client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num,
146 "OPL4 Wavetable");
147 if (client < 0) { 147 if (client < 0) {
148 snd_midi_channel_free_set(opl4->chset); 148 snd_midi_channel_free_set(opl4->chset);
149 return client; 149 return client;
@@ -151,13 +151,6 @@ static int snd_opl4_seq_new_device(struct snd_seq_device *dev)
151 opl4->seq_client = client; 151 opl4->seq_client = client;
152 opl4->chset->client = client; 152 opl4->chset->client = client;
153 153
154 /* change name of client */
155 memset(&cinfo, 0, sizeof(cinfo));
156 cinfo.client = client;
157 cinfo.type = KERNEL_CLIENT;
158 strcpy(cinfo.name, "OPL4 Wavetable");
159 snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo);
160
161 /* create new port */ 154 /* create new port */
162 memset(&pcallbacks, 0, sizeof(pcallbacks)); 155 memset(&pcallbacks, 0, sizeof(pcallbacks));
163 pcallbacks.owner = THIS_MODULE; 156 pcallbacks.owner = THIS_MODULE;