aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-12-12 03:30:43 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:30:47 -0500
commit83e8ad6984dccd6d848ac91ba0df379ff968180b (patch)
tree5ae1f379de542b8ede18ab1cc65537b01b21d212
parent255bd169ab645970f77d3fd7ac800781f96ddccb (diff)
[ALSA] seq: remove struct snd_seq_client_callback
The fields of struct snd_seq_client_callback either aren't used or are always set to the same value, so we can get rid of it altogether. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
-rw-r--r--include/sound/seq_kernel.h12
-rw-r--r--sound/core/seq/oss/seq_oss_init.c9
-rw-r--r--sound/core/seq/seq_clientmgr.c9
-rw-r--r--sound/core/seq/seq_clientmgr.h2
-rw-r--r--sound/core/seq/seq_dummy.c6
-rw-r--r--sound/core/seq/seq_midi.c6
-rw-r--r--sound/core/seq/seq_system.c6
-rw-r--r--sound/core/seq/seq_virmidi.c7
-rw-r--r--sound/drivers/opl3/opl3_seq.c6
-rw-r--r--sound/drivers/opl4/opl4_seq.c6
-rw-r--r--sound/isa/gus/gus_synth.c6
-rw-r--r--sound/pci/trident/trident_synth.c6
-rw-r--r--sound/synth/emux/emux_seq.c8
13 files changed, 14 insertions, 75 deletions
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h
index 1b60890b44cd..77cf57e21489 100644
--- a/include/sound/seq_kernel.h
+++ b/include/sound/seq_kernel.h
@@ -60,15 +60,6 @@ typedef union snd_seq_timestamp snd_seq_timestamp_t;
60/* max size of event size */ 60/* max size of event size */
61#define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff 61#define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff
62 62
63/* call-backs for kernel client */
64
65struct snd_seq_client_callback {
66 void *private_data;
67 unsigned allow_input: 1,
68 allow_output: 1;
69 /*...*/
70};
71
72/* call-backs for kernel port */ 63/* call-backs for kernel port */
73struct snd_seq_port_callback { 64struct snd_seq_port_callback {
74 struct module *owner; 65 struct module *owner;
@@ -84,8 +75,7 @@ struct snd_seq_port_callback {
84}; 75};
85 76
86/* interface for kernel client */ 77/* interface for kernel client */
87int snd_seq_create_kernel_client(struct snd_card *card, int client_index, 78int snd_seq_create_kernel_client(struct snd_card *card, int client_index);
88 struct snd_seq_client_callback *callback);
89int snd_seq_delete_kernel_client(int client); 79int snd_seq_delete_kernel_client(int client);
90int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop); 80int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
91int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop); 81int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop);
diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c
index 97e2493e931f..cd4139adec0b 100644
--- a/sound/core/seq/oss/seq_oss_init.c
+++ b/sound/core/seq/oss/seq_oss_init.c
@@ -65,7 +65,6 @@ int __init
65snd_seq_oss_create_client(void) 65snd_seq_oss_create_client(void)
66{ 66{
67 int rc; 67 int rc;
68 struct snd_seq_client_callback callback;
69 struct snd_seq_client_info *info; 68 struct snd_seq_client_info *info;
70 struct snd_seq_port_info *port; 69 struct snd_seq_port_info *port;
71 struct snd_seq_port_callback port_callback; 70 struct snd_seq_port_callback port_callback;
@@ -78,13 +77,7 @@ snd_seq_oss_create_client(void)
78 } 77 }
79 78
80 /* create ALSA client */ 79 /* create ALSA client */
81 memset(&callback, 0, sizeof(callback)); 80 rc = snd_seq_create_kernel_client(NULL, SNDRV_SEQ_CLIENT_OSS);
82
83 callback.private_data = NULL;
84 callback.allow_input = 1;
85 callback.allow_output = 1;
86
87 rc = snd_seq_create_kernel_client(NULL, SNDRV_SEQ_CLIENT_OSS, &callback);
88 if (rc < 0) 81 if (rc < 0)
89 goto __error; 82 goto __error;
90 83
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 79199f53d63a..bd8c0989785f 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -2212,15 +2212,12 @@ static long snd_seq_ioctl(struct file *file, unsigned int cmd, unsigned long arg
2212 2212
2213 2213
2214/* exported to kernel modules */ 2214/* exported to kernel modules */
2215int snd_seq_create_kernel_client(struct snd_card *card, int client_index, 2215int snd_seq_create_kernel_client(struct snd_card *card, int client_index)
2216 struct snd_seq_client_callback *callback)
2217{ 2216{
2218 struct snd_seq_client *client; 2217 struct snd_seq_client *client;
2219 2218
2220 snd_assert(! in_interrupt(), return -EBUSY); 2219 snd_assert(! in_interrupt(), return -EBUSY);
2221 2220
2222 if (callback == NULL)
2223 return -EINVAL;
2224 if (card && client_index > 3) 2221 if (card && client_index > 3)
2225 return -EINVAL; 2222 return -EINVAL;
2226 if (card == NULL && client_index > 63) 2223 if (card == NULL && client_index > 63)
@@ -2244,8 +2241,8 @@ int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
2244 } 2241 }
2245 usage_alloc(&client_usage, 1); 2242 usage_alloc(&client_usage, 1);
2246 2243
2247 client->accept_input = callback->allow_output; 2244 client->accept_input = 1;
2248 client->accept_output = callback->allow_input; 2245 client->accept_output = 1;
2249 2246
2250 sprintf(client->name, "Client-%d", client->number); 2247 sprintf(client->name, "Client-%d", client->number);
2251 2248
diff --git a/sound/core/seq/seq_clientmgr.h b/sound/core/seq/seq_clientmgr.h
index 7131d218dc75..450091ca153d 100644
--- a/sound/core/seq/seq_clientmgr.h
+++ b/sound/core/seq/seq_clientmgr.h
@@ -91,8 +91,6 @@ struct snd_seq_client *snd_seq_client_use_ptr(int clientid);
91int snd_seq_dispatch_event(struct snd_seq_event_cell *cell, int atomic, int hop); 91int snd_seq_dispatch_event(struct snd_seq_event_cell *cell, int atomic, int hop);
92 92
93/* exported to other modules */ 93/* exported to other modules */
94int snd_seq_register_kernel_client(struct snd_seq_client_callback *callback, void *private_data);
95int snd_seq_unregister_kernel_client(int client);
96int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop); 94int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
97int snd_seq_kernel_client_enqueue_blocking(int client, struct snd_seq_event * ev, 95int snd_seq_kernel_client_enqueue_blocking(int client, struct snd_seq_event * ev,
98 struct file *file, int atomic, int hop); 96 struct file *file, int atomic, int hop);
diff --git a/sound/core/seq/seq_dummy.c b/sound/core/seq/seq_dummy.c
index 8101a475e3e5..e7344b6332da 100644
--- a/sound/core/seq/seq_dummy.c
+++ b/sound/core/seq/seq_dummy.c
@@ -193,7 +193,6 @@ create_port(int idx, int type)
193static int __init 193static int __init
194register_client(void) 194register_client(void)
195{ 195{
196 struct snd_seq_client_callback cb;
197 struct snd_seq_client_info cinfo; 196 struct snd_seq_client_info cinfo;
198 struct snd_seq_dummy_port *rec1, *rec2; 197 struct snd_seq_dummy_port *rec1, *rec2;
199 int i; 198 int i;
@@ -204,10 +203,7 @@ register_client(void)
204 } 203 }
205 204
206 /* create client */ 205 /* create client */
207 memset(&cb, 0, sizeof(cb)); 206 my_client = snd_seq_create_kernel_client(NULL, SNDRV_SEQ_CLIENT_DUMMY);
208 cb.allow_input = 1;
209 cb.allow_output = 1;
210 my_client = snd_seq_create_kernel_client(NULL, SNDRV_SEQ_CLIENT_DUMMY, &cb);
211 if (my_client < 0) 207 if (my_client < 0)
212 return my_client; 208 return my_client;
213 209
diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c
index 0a65eb2f976b..512ffddd158c 100644
--- a/sound/core/seq/seq_midi.c
+++ b/sound/core/seq/seq_midi.c
@@ -295,7 +295,6 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev)
295 struct snd_rawmidi_info *info; 295 struct snd_rawmidi_info *info;
296 int newclient = 0; 296 int newclient = 0;
297 unsigned int p, ports; 297 unsigned int p, ports;
298 struct snd_seq_client_callback callbacks;
299 struct snd_seq_port_callback pcallbacks; 298 struct snd_seq_port_callback pcallbacks;
300 struct snd_card *card = dev->card; 299 struct snd_card *card = dev->card;
301 int device = dev->device; 300 int device = dev->device;
@@ -334,10 +333,7 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev)
334 kfree(info); 333 kfree(info);
335 return -ENOMEM; 334 return -ENOMEM;
336 } 335 }
337 memset(&callbacks, 0, sizeof(callbacks)); 336 client->seq_client = snd_seq_create_kernel_client(card, 0);
338 callbacks.private_data = client;
339 callbacks.allow_input = callbacks.allow_output = 1;
340 client->seq_client = snd_seq_create_kernel_client(card, 0, &callbacks);
341 if (client->seq_client < 0) { 337 if (client->seq_client < 0) {
342 kfree(client); 338 kfree(client);
343 up(&register_mutex); 339 up(&register_mutex);
diff --git a/sound/core/seq/seq_system.c b/sound/core/seq/seq_system.c
index 86b1cba33c08..c87c883bd92d 100644
--- a/sound/core/seq/seq_system.c
+++ b/sound/core/seq/seq_system.c
@@ -120,8 +120,6 @@ static int event_input_timer(struct snd_seq_event * ev, int direct, void *privat
120/* register our internal client */ 120/* register our internal client */
121int __init snd_seq_system_client_init(void) 121int __init snd_seq_system_client_init(void)
122{ 122{
123
124 struct snd_seq_client_callback callbacks;
125 struct snd_seq_port_callback pcallbacks; 123 struct snd_seq_port_callback pcallbacks;
126 struct snd_seq_client_info *inf; 124 struct snd_seq_client_info *inf;
127 struct snd_seq_port_info *port; 125 struct snd_seq_port_info *port;
@@ -134,14 +132,12 @@ int __init snd_seq_system_client_init(void)
134 return -ENOMEM; 132 return -ENOMEM;
135 } 133 }
136 134
137 memset(&callbacks, 0, sizeof(callbacks));
138 memset(&pcallbacks, 0, sizeof(pcallbacks)); 135 memset(&pcallbacks, 0, sizeof(pcallbacks));
139 pcallbacks.owner = THIS_MODULE; 136 pcallbacks.owner = THIS_MODULE;
140 pcallbacks.event_input = event_input_timer; 137 pcallbacks.event_input = event_input_timer;
141 138
142 /* register client */ 139 /* register client */
143 callbacks.allow_input = callbacks.allow_output = 1; 140 sysclient = snd_seq_create_kernel_client(NULL, 0);
144 sysclient = snd_seq_create_kernel_client(NULL, 0, &callbacks);
145 141
146 /* set our name */ 142 /* set our name */
147 inf->client = 0; 143 inf->client = 0;
diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c
index ea2113968fe7..2739f5772578 100644
--- a/sound/core/seq/seq_virmidi.c
+++ b/sound/core/seq/seq_virmidi.c
@@ -359,7 +359,6 @@ static struct snd_rawmidi_ops snd_virmidi_output_ops = {
359static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev) 359static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev)
360{ 360{
361 int client; 361 int client;
362 struct snd_seq_client_callback callbacks;
363 struct snd_seq_port_callback pcallbacks; 362 struct snd_seq_port_callback pcallbacks;
364 struct snd_seq_client_info *info; 363 struct snd_seq_client_info *info;
365 struct snd_seq_port_info *pinfo; 364 struct snd_seq_port_info *pinfo;
@@ -375,11 +374,7 @@ static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev)
375 goto __error; 374 goto __error;
376 } 375 }
377 376
378 memset(&callbacks, 0, sizeof(callbacks)); 377 client = snd_seq_create_kernel_client(rdev->card, rdev->device);
379 callbacks.private_data = rdev;
380 callbacks.allow_input = 1;
381 callbacks.allow_output = 1;
382 client = snd_seq_create_kernel_client(rdev->card, rdev->device, &callbacks);
383 if (client < 0) { 378 if (client < 0) {
384 err = client; 379 err = client;
385 goto __error; 380 goto __error;
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c
index 1886b2958e77..582ff63e784b 100644
--- a/sound/drivers/opl3/opl3_seq.c
+++ b/sound/drivers/opl3/opl3_seq.c
@@ -219,7 +219,6 @@ 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_callback callbacks;
223 struct snd_seq_client_info cinfo; 222 struct snd_seq_client_info cinfo;
224 int opl_ver; 223 int opl_ver;
225 224
@@ -232,11 +231,8 @@ static int snd_opl3_seq_new_device(struct snd_seq_device *dev)
232 opl3->seq_client = -1; 231 opl3->seq_client = -1;
233 232
234 /* allocate new client */ 233 /* allocate new client */
235 memset(&callbacks, 0, sizeof(callbacks));
236 callbacks.private_data = opl3;
237 callbacks.allow_output = callbacks.allow_input = 1;
238 client = opl3->seq_client = 234 client = opl3->seq_client =
239 snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num, &callbacks); 235 snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num);
240 if (client < 0) 236 if (client < 0)
241 return client; 237 return client;
242 238
diff --git a/sound/drivers/opl4/opl4_seq.c b/sound/drivers/opl4/opl4_seq.c
index bfd68e49c914..a69117dd0071 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_callback callbacks;
131 struct snd_seq_client_info cinfo; 130 struct snd_seq_client_info cinfo;
132 struct snd_seq_port_callback pcallbacks; 131 struct snd_seq_port_callback pcallbacks;
133 132
@@ -144,10 +143,7 @@ static int snd_opl4_seq_new_device(struct snd_seq_device *dev)
144 opl4->chset->private_data = opl4; 143 opl4->chset->private_data = opl4;
145 144
146 /* allocate new client */ 145 /* allocate new client */
147 memset(&callbacks, 0, sizeof(callbacks)); 146 client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num);
148 callbacks.private_data = opl4;
149 callbacks.allow_output = callbacks.allow_input = 1;
150 client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num, &callbacks);
151 if (client < 0) { 147 if (client < 0) {
152 snd_midi_channel_free_set(opl4->chset); 148 snd_midi_channel_free_set(opl4->chset);
153 return client; 149 return client;
diff --git a/sound/isa/gus/gus_synth.c b/sound/isa/gus/gus_synth.c
index 9c7d6986f62f..6464488363e4 100644
--- a/sound/isa/gus/gus_synth.c
+++ b/sound/isa/gus/gus_synth.c
@@ -214,7 +214,6 @@ static int snd_gus_synth_new_device(struct snd_seq_device *dev)
214{ 214{
215 struct snd_gus_card *gus; 215 struct snd_gus_card *gus;
216 int client, i; 216 int client, i;
217 struct snd_seq_client_callback callbacks;
218 struct snd_seq_client_info *cinfo; 217 struct snd_seq_client_info *cinfo;
219 struct snd_seq_port_subscribe sub; 218 struct snd_seq_port_subscribe sub;
220 struct snd_iwffff_ops *iwops; 219 struct snd_iwffff_ops *iwops;
@@ -233,11 +232,8 @@ static int snd_gus_synth_new_device(struct snd_seq_device *dev)
233 return -ENOMEM; 232 return -ENOMEM;
234 233
235 /* allocate new client */ 234 /* allocate new client */
236 memset(&callbacks, 0, sizeof(callbacks));
237 callbacks.private_data = gus;
238 callbacks.allow_output = callbacks.allow_input = 1;
239 client = gus->gf1.seq_client = 235 client = gus->gf1.seq_client =
240 snd_seq_create_kernel_client(gus->card, 1, &callbacks); 236 snd_seq_create_kernel_client(gus->card, 1);
241 if (client < 0) { 237 if (client < 0) {
242 kfree(cinfo); 238 kfree(cinfo);
243 return client; 239 return client;
diff --git a/sound/pci/trident/trident_synth.c b/sound/pci/trident/trident_synth.c
index a49682ef3e3e..e31055a4bd25 100644
--- a/sound/pci/trident/trident_synth.c
+++ b/sound/pci/trident/trident_synth.c
@@ -934,7 +934,6 @@ static int snd_trident_synth_new_device(struct snd_seq_device *dev)
934{ 934{
935 struct snd_trident *trident; 935 struct snd_trident *trident;
936 int client, i; 936 int client, i;
937 struct snd_seq_client_callback callbacks;
938 struct snd_seq_client_info cinfo; 937 struct snd_seq_client_info cinfo;
939 struct snd_seq_port_subscribe sub; 938 struct snd_seq_port_subscribe sub;
940 struct snd_simple_ops *simpleops; 939 struct snd_simple_ops *simpleops;
@@ -947,11 +946,8 @@ static int snd_trident_synth_new_device(struct snd_seq_device *dev)
947 trident->synth.seq_client = -1; 946 trident->synth.seq_client = -1;
948 947
949 /* allocate new client */ 948 /* allocate new client */
950 memset(&callbacks, 0, sizeof(callbacks));
951 callbacks.private_data = trident;
952 callbacks.allow_output = callbacks.allow_input = 1;
953 client = trident->synth.seq_client = 949 client = trident->synth.seq_client =
954 snd_seq_create_kernel_client(trident->card, 1, &callbacks); 950 snd_seq_create_kernel_client(trident->card, 1);
955 if (client < 0) 951 if (client < 0)
956 return client; 952 return client;
957 953
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
index f5a832ff362c..b7129c5aee06 100644
--- a/sound/synth/emux/emux_seq.c
+++ b/sound/synth/emux/emux_seq.c
@@ -347,17 +347,11 @@ snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info)
347static int 347static int
348get_client(struct snd_card *card, int index, char *name) 348get_client(struct snd_card *card, int index, char *name)
349{ 349{
350 struct snd_seq_client_callback callbacks;
351 struct snd_seq_client_info cinfo; 350 struct snd_seq_client_info cinfo;
352 int client; 351 int client;
353 352
354 memset(&callbacks, 0, sizeof(callbacks));
355 callbacks.private_data = NULL;
356 callbacks.allow_input = 1;
357 callbacks.allow_output = 1;
358
359 /* Find a free client, start from 1 as the MPU expects to use 0 */ 353 /* Find a free client, start from 1 as the MPU expects to use 0 */
360 client = snd_seq_create_kernel_client(card, index, &callbacks); 354 client = snd_seq_create_kernel_client(card, index);
361 if (client < 0) 355 if (client < 0)
362 return client; 356 return client;
363 357