X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fcore%2Fseq%2Fseq_system.c;fp=sound%2Fcore%2Fseq%2Fseq_system.c;h=b201b76e9412b58b9761f4fdf3bbf2e30bbffc3a;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=e8f0a6683d50b5a9305df2642990313c578061e1;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/sound/core/seq/seq_system.c b/sound/core/seq/seq_system.c index e8f0a6683..b201b76e9 100644 --- a/sound/core/seq/seq_system.c +++ b/sound/core/seq/seq_system.c @@ -66,12 +66,12 @@ static int announce_port = -1; /* fill standard header data, source port & channel are filled in */ -static int setheader(snd_seq_event_t * ev, int client, int port) +static int setheader(struct snd_seq_event * ev, int client, int port) { if (announce_port < 0) return -ENODEV; - memset(ev, 0, sizeof(snd_seq_event_t)); + memset(ev, 0, sizeof(struct snd_seq_event)); ev->flags &= ~SNDRV_SEQ_EVENT_LENGTH_MASK; ev->flags |= SNDRV_SEQ_EVENT_LENGTH_FIXED; @@ -92,7 +92,7 @@ static int setheader(snd_seq_event_t * ev, int client, int port) /* entry points for broadcasting system events */ void snd_seq_system_broadcast(int client, int port, int type) { - snd_seq_event_t ev; + struct snd_seq_event ev; if (setheader(&ev, client, port) < 0) return; @@ -101,7 +101,7 @@ void snd_seq_system_broadcast(int client, int port, int type) } /* entry points for broadcasting system events */ -int snd_seq_system_notify(int client, int port, snd_seq_event_t *ev) +int snd_seq_system_notify(int client, int port, struct snd_seq_event *ev) { ev->flags = SNDRV_SEQ_EVENT_LENGTH_FIXED; ev->source.client = sysclient; @@ -112,7 +112,7 @@ int snd_seq_system_notify(int client, int port, snd_seq_event_t *ev) } /* call-back handler for timer events */ -static int event_input_timer(snd_seq_event_t * ev, int direct, void *private_data, int atomic, int hop) +static int event_input_timer(struct snd_seq_event * ev, int direct, void *private_data, int atomic, int hop) { return snd_seq_control_queue(ev, atomic, hop); } @@ -120,34 +120,19 @@ static int event_input_timer(snd_seq_event_t * ev, int direct, void *private_dat /* register our internal client */ int __init snd_seq_system_client_init(void) { + struct snd_seq_port_callback pcallbacks; + struct snd_seq_port_info *port; - snd_seq_client_callback_t callbacks; - snd_seq_port_callback_t pcallbacks; - snd_seq_client_info_t *inf; - snd_seq_port_info_t *port; - - inf = kcalloc(1, sizeof(*inf), GFP_KERNEL); - port = kcalloc(1, sizeof(*port), GFP_KERNEL); - if (! inf || ! port) { - kfree(inf); - kfree(port); + port = kzalloc(sizeof(*port), GFP_KERNEL); + if (!port) return -ENOMEM; - } - memset(&callbacks, 0, sizeof(callbacks)); memset(&pcallbacks, 0, sizeof(pcallbacks)); pcallbacks.owner = THIS_MODULE; pcallbacks.event_input = event_input_timer; /* register client */ - callbacks.allow_input = callbacks.allow_output = 1; - sysclient = snd_seq_create_kernel_client(NULL, 0, &callbacks); - - /* 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"); @@ -171,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; }