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

Modified Files:
        korg1212.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: korg1212.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/korg1212/korg1212.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- korg1212.c  6 Jan 2003 09:24:55 -0000       1.23
+++ korg1212.c  7 Jan 2003 10:36:31 -0000       1.24
@@ -368,7 +368,6 @@
 
         snd_pcm_substream_t *playback_substream;
         snd_pcm_substream_t *capture_substream;
-        snd_info_entry_t * proc_entry;
 
        CardState cardState;
         int running;
@@ -1898,26 +1897,8 @@
 {
        snd_info_entry_t *entry;
 
-       if ((entry = snd_info_create_card_entry(korg1212->card, "korg1212", 
korg1212->card->proc_root)) != NULL) {
-               entry->content = SNDRV_INFO_CONTENT_TEXT;
-               entry->private_data = korg1212;
-               entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
-               entry->c.text.read_size = 256;
-               entry->c.text.read = snd_korg1212_proc_read;
-               if (snd_info_register(entry) < 0) {
-                       snd_info_free_entry(entry);
-                       entry = NULL;
-               }
-       }
-       korg1212->proc_entry = entry;
-}
-
-static void snd_korg1212_proc_done(korg1212_t * korg1212)
-{
-       if (korg1212->proc_entry) {
-               snd_info_unregister(korg1212->proc_entry);
-               korg1212->proc_entry = NULL;
-       }
+       if (! snd_card_proc_new(korg1212->card, "korg1212", &entry))
+               snd_info_set_text_ops(entry, korg1212, snd_korg1212_proc_read);
 }
 
 static int __devinit snd_korg1212_create(korg1212_t *korg1212)
@@ -2173,8 +2154,6 @@
         if (korg1212 == NULL) {
                 return;
         }
-
-        snd_korg1212_proc_done(korg1212);
 
         snd_korg1212_TurnOffIdleMonitor(korg1212);
 



-------------------------------------------------------
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