Update of /cvsroot/alsa/alsa-kernel/usb
In directory sc8-pr-cvs1:/tmp/cvs-serv6295/usb

Modified Files:
        usbaudio.c 
Log Message:
[PATCH: proc-card-dev.dif]

- added snd_card_proc_new() to create a normal text proc file for
  the card basis.  it's handled as an ALSA device, so no explicit
  destruction is necessary.

- snd_info_set_text_ops() to set the callback function for convenience.

- applied the new function to each source and clean-up.



Index: usbaudio.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbaudio.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- usbaudio.c  7 Jan 2003 10:27:55 -0000       1.32
+++ usbaudio.c  7 Jan 2003 10:36:32 -0000       1.33
@@ -184,7 +184,6 @@
        int pcm_index;
        snd_usb_substream_t substream[2];
        struct list_head list;
-       snd_info_entry_t *proc_entry;
 };
 
 #define chip_t snd_usb_stream_t
@@ -1456,18 +1455,8 @@
        snd_card_t *card = stream->chip->card;
 
        sprintf(name, "stream%d", stream->pcm_index);
-       if ((entry = snd_info_create_card_entry(card, name, card->proc_root)) != NULL) 
{
-               entry->content = SNDRV_INFO_CONTENT_TEXT;
-               entry->private_data = stream;
-               entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
-               entry->c.text.read_size = 4096;
-               entry->c.text.read = proc_pcm_format_read;
-               if (snd_info_register(entry) < 0) {
-                       snd_info_free_entry(entry);
-                       entry = NULL;
-               }
-       }
-       stream->proc_entry = entry;
+       if (! snd_card_proc_new(card, name, &entry))
+               snd_info_set_text_ops(entry, stream, proc_pcm_format_read);
 }
 
 
@@ -1522,10 +1511,6 @@
  */
 static void snd_usb_audio_stream_free(snd_usb_stream_t *stream)
 {
-       if (stream->proc_entry) {
-               snd_info_unregister(stream->proc_entry);
-               stream->proc_entry = NULL;
-       }
        free_substream(&stream->substream[0]);
        free_substream(&stream->substream[1]);
        list_del(&stream->list);



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to