MODULE_AUTHOR("Frank van de Pol <fvdpol@coil.demon.nl>, Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer MIDI synth.");
MODULE_LICENSE("GPL");
-MODULE_CLASSES("{sound}");
-MODULE_SUPPORTED_DEVICE("sound");
-int output_buffer_size = PAGE_SIZE;
+static int output_buffer_size = PAGE_SIZE;
module_param(output_buffer_size, int, 0644);
MODULE_PARM_DESC(output_buffer_size, "Output buffer size in bytes.");
-int input_buffer_size = PAGE_SIZE;
+static int input_buffer_size = PAGE_SIZE;
module_param(input_buffer_size, int, 0644);
MODULE_PARM_DESC(input_buffer_size, "Input buffer size in bytes.");
cinfo.client = client->seq_client;
cinfo.type = KERNEL_CLIENT;
name = rmidi->name[0] ? (const char *)rmidi->name : "External MIDI";
- snprintf(cinfo.name, sizeof(cinfo.name), "%s - Rawmidi %d", name, card->number);
+ strlcpy(cinfo.name, name, sizeof(cinfo.name));
return snd_seq_kernel_client_ctl(client->seq_client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo);
}
/* register new midi synth port */
-int
+static int
snd_seq_midisynth_register_port(snd_seq_device_t *dev)
{
seq_midisynth_client_t *client;
client = synths[card->number];
if (client == NULL) {
newclient = 1;
- client = snd_kcalloc(sizeof(seq_midisynth_client_t), GFP_KERNEL);
+ client = kcalloc(1, sizeof(*client), GFP_KERNEL);
if (client == NULL) {
up(®ister_mutex);
return -ENOMEM;
} else if (device == 0)
set_client_name(client, card, &info); /* use the first device's name */
- msynth = snd_kcalloc(sizeof(seq_midisynth_t) * ports, GFP_KERNEL);
+ msynth = kcalloc(ports, sizeof(seq_midisynth_t), GFP_KERNEL);
if (msynth == NULL)
goto __nomem;
}
/* release midi synth port */
-int
+static int
snd_seq_midisynth_unregister_port(snd_seq_device_t *dev)
{
seq_midisynth_client_t *client;
snd_seq_midisynth_unregister_port,
};
memset(&synths, 0, sizeof(synths));
+ snd_seq_autoload_lock();
snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_MIDISYNTH, &ops, 0);
+ snd_seq_autoload_unlock();
return 0;
}