diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-12-12 03:33:37 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:30:49 -0500 |
commit | 7b6d92451ad5e1136dc347347e888b94638b8ba9 (patch) | |
tree | e62edf62f29e988378cd2c984cde0ccb0993120b /sound/core/seq/seq_clientmgr.c | |
parent | 83e8ad6984dccd6d848ac91ba0df379ff968180b (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/core/seq/seq_clientmgr.c')
-rw-r--r-- | sound/core/seq/seq_clientmgr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index bd8c0989785f..606d076f72f4 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c | |||
@@ -2212,9 +2212,11 @@ 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 | const char *name_fmt, ...) | ||
2216 | { | 2217 | { |
2217 | struct snd_seq_client *client; | 2218 | struct snd_seq_client *client; |
2219 | va_list args; | ||
2218 | 2220 | ||
2219 | snd_assert(! in_interrupt(), return -EBUSY); | 2221 | snd_assert(! in_interrupt(), return -EBUSY); |
2220 | 2222 | ||
@@ -2244,7 +2246,9 @@ int snd_seq_create_kernel_client(struct snd_card *card, int client_index) | |||
2244 | client->accept_input = 1; | 2246 | client->accept_input = 1; |
2245 | client->accept_output = 1; | 2247 | client->accept_output = 1; |
2246 | 2248 | ||
2247 | sprintf(client->name, "Client-%d", client->number); | 2249 | va_start(args, name_fmt); |
2250 | vsnprintf(client->name, sizeof(client->name), name_fmt, args); | ||
2251 | va_end(args); | ||
2248 | 2252 | ||
2249 | client->type = KERNEL_CLIENT; | 2253 | client->type = KERNEL_CLIENT; |
2250 | up(®ister_mutex); | 2254 | up(®ister_mutex); |