[PATCH] : Sound module locking - uart401

Chris Rankin (rankinc@zip.com.au)
Sat, 20 Jan 2001 20:00:27 +1100 (EST)


Hi,
I was going to save this patch until people (Alan) returned from
linux.conf.au, but seeing as 2.4.0-ac10 has just been posted ...

This patch makes the uart401 honour the module owner for MIDI and
synth devices, and then moves the MIDI operations into the text
section.

Chris

--- linux-2.4.0/drivers/sound/uart401.c.orig Wed Jan 17 01:24:40 2001
+++ linux-2.4.0/drivers/sound/uart401.c Thu Jan 18 01:44:49 2001
@@ -202,7 +202,7 @@
#define MIDI_SYNTH_CAPS SYNTH_CAP_INPUT
#include "midi_synth.h"

-static struct midi_operations uart401_operations =
+static const struct midi_operations uart401_operations =
{
owner: THIS_MODULE,
info: {"MPU-401 (UART) MIDI", 0, 0, SNDCARD_MPU401},
@@ -351,7 +351,6 @@
goto cleanup_irq;
}
conf_printf(name, hw_config);
- std_midi_synth.midi_dev = devc->my_dev;
midi_devs[devc->my_dev] = kmalloc(sizeof(struct midi_operations), GFP_KERNEL);
if (!midi_devs[devc->my_dev]) {
printk(KERN_ERR "uart401: Failed to allocate memory\n");
@@ -371,6 +370,11 @@
memcpy(midi_devs[devc->my_dev]->converter, &std_midi_synth, sizeof(struct synth_operations));
strcpy(midi_devs[devc->my_dev]->info.name, name);
midi_devs[devc->my_dev]->converter->id = "UART401";
+ midi_devs[devc->my_dev]->converter->midi_dev = devc->my_dev;
+
+ if (owner)
+ midi_devs[devc->my_dev]->converter->owner = owner;
+
hw_config->slots[4] = devc->my_dev;
sequencer_init();
devc->opened = 0;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/