[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>
This commit is contained in:
committed by
Jaroslav Kysela
parent
83e8ad6984
commit
7b6d92451a
@@ -2212,9 +2212,11 @@ static long snd_seq_ioctl(struct file *file, unsigned int cmd, unsigned long arg
|
||||
|
||||
|
||||
/* exported to kernel modules */
|
||||
int snd_seq_create_kernel_client(struct snd_card *card, int client_index)
|
||||
int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
|
||||
const char *name_fmt, ...)
|
||||
{
|
||||
struct snd_seq_client *client;
|
||||
va_list args;
|
||||
|
||||
snd_assert(! in_interrupt(), return -EBUSY);
|
||||
|
||||
@@ -2244,7 +2246,9 @@ int snd_seq_create_kernel_client(struct snd_card *card, int client_index)
|
||||
client->accept_input = 1;
|
||||
client->accept_output = 1;
|
||||
|
||||
sprintf(client->name, "Client-%d", client->number);
|
||||
va_start(args, name_fmt);
|
||||
vsnprintf(client->name, sizeof(client->name), name_fmt, args);
|
||||
va_end(args);
|
||||
|
||||
client->type = KERNEL_CLIENT;
|
||||
up(®ister_mutex);
|
||||
|
Reference in New Issue
Block a user