Re: [PATCH] alsa-driver: portman2x4 code cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Takashi Iwai <tiwai@xxxxxxx> writes:
>> Signed-off-by: Matthias Koenig <mkoenig@xxxxxxx>
>> ============================================================
>> Summary: portman2x4 code cleanup
>> 
>> - changed code structure to mirror the one of the mts64.c driver 
>>   for better maintenance
>> - added proper handling of platform device
>> - general cleanup (no CamelCase names)
>
> Thanks, the changes look good to me.
>
> Since the patch couldn't be applied cleanly, I fixed it manually.

Hmm, what was the problem? I just used the hg quilt extensions
and took the resulting patch.

> Also, added cpu_relax() in busy loops, and fixed unneeded
> initialization of variables.

Ok, thanks

> The code is now committed to ALSA HG tree.  Please give it a try.

Ah, I just tested and found that the rawmidi open/close callbacks
have to be defined and cannot be NULL. So the driver as it is
will oops if device will be opened.
Fixed this, now tested with amidi input/output on all ports works
fine. Patch is below.

> BTW, if the driver works for you, we can move this to alsa-kernel tree
> so that it's merged to the upstream kernel...

Great, yes I think it can then be moved to alsa-kernel tree.

Matthias

Signed-off-by: Matthias Koenig <mkoenig@xxxxxxx>
===========================================================
Summary: Fix callbacks

diff -r 34388b137f38 drivers/portman2x4-kernel.c
--- a/drivers/portman2x4-kernel.c	Wed Jan 24 17:57:48 2007 +0100
+++ b/drivers/portman2x4-kernel.c	Wed Jan 24 20:14:19 2007 +0100
@@ -508,6 +508,15 @@ static int portman_device_init(struct po
 /*********************************************************************
  * Rawmidi
  *********************************************************************/
+static int snd_portman_midi_open(struct snd_rawmidi_substream *substream)
+{
+	return 0;
+}
+
+static int snd_portman_midi_close(struct snd_rawmidi_substream *substream)
+{
+	return 0;
+}
 
 static void snd_portman_midi_input_trigger(struct snd_rawmidi_substream *substream,
 					   int up)
@@ -539,14 +548,14 @@ static void snd_portman_midi_output_trig
 }
 
 static struct snd_rawmidi_ops snd_portman_midi_output = {
-	.open =		NULL,
-	.close =	NULL,
+	.open =		snd_portman_midi_open,
+	.close =	snd_portman_midi_close,
 	.trigger =	snd_portman_midi_output_trigger,
 };
 
 static struct snd_rawmidi_ops snd_portman_midi_input = {
-	.open =		NULL,
-	.close =	NULL,
+	.open =		snd_portman_midi_open,
+	.close =	snd_portman_midi_close,
 	.trigger =	snd_portman_midi_input_trigger,
 };
 
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux