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

Modified Files:
        trident_main.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: trident_main.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/trident/trident_main.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- trident_main.c      7 Jan 2003 10:25:27 -0000       1.21
+++ trident_main.c      7 Jan 2003 10:36:32 -0000       1.22
@@ -3173,30 +3173,12 @@
 static void __devinit snd_trident_proc_init(trident_t * trident)
 {
        snd_info_entry_t *entry;
-       char *s = "trident";
+       const char *s = "trident";
        
        if (trident->device == TRIDENT_DEVICE_ID_SI7018)
                s = "sis7018";
-       if ((entry = snd_info_create_card_entry(trident->card, s, 
trident->card->proc_root)) != NULL) {
-               entry->content = SNDRV_INFO_CONTENT_TEXT;
-               entry->private_data = trident;
-               entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
-               entry->c.text.read_size = 256;
-               entry->c.text.read = snd_trident_proc_read;
-               if (snd_info_register(entry) < 0) {
-                       snd_info_free_entry(entry);
-                       entry = NULL;
-               }
-       }
-       trident->proc_entry = entry;
-}
-
-static void snd_trident_proc_done(trident_t * trident)
-{
-       if (trident->proc_entry) {
-               snd_info_unregister(trident->proc_entry);
-               trident->proc_entry = NULL;
-       }
+       if (! snd_card_proc_new(trident->card, s, &entry))
+               snd_info_set_text_ops(entry, trident, snd_trident_proc_read);
 }
 
 static int snd_trident_dev_free(snd_device_t *device)
@@ -3493,7 +3475,6 @@
        else if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
                outl(0, TRID_REG(trident, SI_SERIAL_INTF_CTRL));
        }
-       snd_trident_proc_done(trident);
        if (trident->tlb.buffer) {
                outl(0, TRID_REG(trident, NX_TLBC));
                if (trident->tlb.memhdr)



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