diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-12-12 03:30:43 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:30:47 -0500 |
commit | 83e8ad6984dccd6d848ac91ba0df379ff968180b (patch) | |
tree | 5ae1f379de542b8ede18ab1cc65537b01b21d212 /sound/core | |
parent | 255bd169ab645970f77d3fd7ac800781f96ddccb (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>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/seq/oss/seq_oss_init.c | 9 | ||||
-rw-r--r-- | sound/core/seq/seq_clientmgr.c | 9 | ||||
-rw-r--r-- | sound/core/seq/seq_clientmgr.h | 2 | ||||
-rw-r--r-- | sound/core/seq/seq_dummy.c | 6 | ||||
-rw-r--r-- | sound/core/seq/seq_midi.c | 6 | ||||
-rw-r--r-- | sound/core/seq/seq_system.c | 6 | ||||
-rw-r--r-- | sound/core/seq/seq_virmidi.c | 7 |
7 files changed, 8 insertions, 37 deletions
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 | |||
65 | snd_seq_oss_create_client(void) | 65 | snd_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 */ |
2215 | int snd_seq_create_kernel_client(struct snd_card *card, int client_index, | 2215 | int 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); | |||
91 | int snd_seq_dispatch_event(struct snd_seq_event_cell *cell, int atomic, int hop); | 91 | int 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 */ |
94 | int snd_seq_register_kernel_client(struct snd_seq_client_callback *callback, void *private_data); | ||
95 | int snd_seq_unregister_kernel_client(int client); | ||
96 | int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop); | 94 | int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop); |
97 | int snd_seq_kernel_client_enqueue_blocking(int client, struct snd_seq_event * ev, | 95 | int 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) | |||
193 | static int __init | 193 | static int __init |
194 | register_client(void) | 194 | register_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(®ister_mutex); | 339 | up(®ister_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 */ |
121 | int __init snd_seq_system_client_init(void) | 121 | int __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 = { | |||
359 | static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev) | 359 | static 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; |