From 7b6d92451ad5e1136dc347347e888b94638b8ba9 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 12 Dec 2005 09:33:37 +0100 Subject: [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 --- sound/core/seq/seq_virmidi.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'sound/core/seq/seq_virmidi.c') diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c index 2739f57..14fd1a6 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; } -- cgit v1.1