mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] : Sound module locking - uart401
@ 2001-01-20  9:00 Chris Rankin
  0 siblings, 0 replies; only message in thread
From: Chris Rankin @ 2001-01-20  9:00 UTC (permalink / raw)
  To: linux-kernel, linux-sound

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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-01-20  9:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-20  9:00 [PATCH] : Sound module locking - uart401 Chris Rankin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®