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_system.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_system.c')
-rw-r--r-- | sound/core/seq/seq_system.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/sound/core/seq/seq_system.c b/sound/core/seq/seq_system.c index c87c883bd92d..b201b76e9412 100644 --- a/sound/core/seq/seq_system.c +++ b/sound/core/seq/seq_system.c @@ -121,29 +121,18 @@ static int event_input_timer(struct snd_seq_event * ev, int direct, void *privat int __init snd_seq_system_client_init(void) { struct snd_seq_port_callback pcallbacks; - struct snd_seq_client_info *inf; struct snd_seq_port_info *port; - inf = kzalloc(sizeof(*inf), GFP_KERNEL); port = kzalloc(sizeof(*port), GFP_KERNEL); - if (! inf || ! port) { - kfree(inf); - kfree(port); + if (!port) return -ENOMEM; - } memset(&pcallbacks, 0, sizeof(pcallbacks)); pcallbacks.owner = THIS_MODULE; pcallbacks.event_input = event_input_timer; /* register client */ - sysclient = snd_seq_create_kernel_client(NULL, 0); - - /* set our name */ - inf->client = 0; - inf->type = KERNEL_CLIENT; - strcpy(inf->name, "System"); - snd_seq_kernel_client_ctl(sysclient, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, inf); + sysclient = snd_seq_create_kernel_client(NULL, 0, "System"); /* register timer */ strcpy(port->name, "Timer"); @@ -167,7 +156,6 @@ int __init snd_seq_system_client_init(void) snd_seq_kernel_client_ctl(sysclient, SNDRV_SEQ_IOCTL_CREATE_PORT, port); announce_port = port->addr.port; - kfree(inf); kfree(port); return 0; } |