diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-12-12 09:33:37 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 12:30:49 +0100 |
commit | 7b6d92451ad5e1136dc347347e888b94638b8ba9 (patch) | |
tree | e62edf62f29e988378cd2c984cde0ccb0993120b /sound/core/seq/seq_virmidi.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_virmidi.c')
-rw-r--r-- | sound/core/seq/seq_virmidi.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c index 2739f5772578..14fd1a608e14 100644 --- a/sound/core/seq/seq_virmidi.c +++ b/sound/core/seq/seq_virmidi.c @@ -360,34 +360,28 @@ static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev) { int client; struct snd_seq_port_callback pcallbacks; - struct snd_seq_client_info *info; struct snd_seq_port_info *pinfo; int err; if (rdev->client >= 0) return 0; - info = kmalloc(sizeof(*info), GFP_KERNEL); pinfo = kmalloc(sizeof(*pinfo), GFP_KERNEL); - if (! info || ! pinfo) { + if (!pinfo) { err = -ENOMEM; goto __error; } - client = snd_seq_create_kernel_client(rdev->card, rdev->device); + client = snd_seq_create_kernel_client(rdev->card, rdev->device, + "%s %d-%d", rdev->rmidi->name, + rdev->card->number, + rdev->device); if (client < 0) { err = client; goto __error; } rdev->client = client; - /* set client name */ - memset(info, 0, sizeof(*info)); - info->client = client; - info->type = KERNEL_CLIENT; - sprintf(info->name, "%s %d-%d", rdev->rmidi->name, rdev->card->number, rdev->device); - snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, info); - /* create a port */ memset(pinfo, 0, sizeof(*pinfo)); pinfo->addr.client = client; @@ -418,7 +412,6 @@ static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev) err = 0; /* success */ __error: - kfree(info); kfree(pinfo); return err; } |