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

Modified Files:
        uda1341.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: uda1341.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/i2c/l3/uda1341.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- uda1341.c   9 Nov 2002 13:12:19 -0000       1.5
+++ uda1341.c   7 Jan 2003 10:36:28 -0000       1.6
@@ -128,9 +128,6 @@
 
        snd_card_t *card;
 
-       snd_info_entry_t *proc_entry;
-       snd_info_entry_t *proc_regs_entry;
-
        uda1341_cfg cfg;
 };
 
@@ -410,46 +407,10 @@
 
        DEBUG_NAME(KERN_DEBUG "proc_init\n");
         
-       if ((entry = snd_info_create_card_entry(card, "uda1341", card->proc_root)) != 
NULL) {
-               entry->content = SNDRV_INFO_CONTENT_TEXT;
-               entry->private_data = clnt;
-               entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
-               entry->c.text.read_size = 512;
-               entry->c.text.read = snd_uda1341_proc_read;
-               if (snd_info_register(entry) < 0) {
-                       snd_info_free_entry(entry);
-                       entry = NULL;
-               }
-       }
-       uda->proc_entry = entry;
-       if ((entry = snd_info_create_card_entry(card, "uda1341-regs", 
card->proc_root)) != NULL) {
-               entry->content = SNDRV_INFO_CONTENT_TEXT;
-               entry->private_data = clnt;
-               entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
-               entry->c.text.read_size = 1024;
-               entry->c.text.read = snd_uda1341_proc_regs_read;
-               if (snd_info_register(entry) < 0) {
-                       snd_info_free_entry(entry);
-                       entry = NULL;
-               }
-       }
-       uda->proc_regs_entry = entry;   
-}
-
-static void snd_uda1341_proc_done(struct l3_client *clnt)
-{
-       struct uda1341 *uda = clnt->driver_data;
-
-       DEBUG_NAME(KERN_DEBUG "proc_done\n");
-        
-       if (uda->proc_regs_entry) {
-               snd_info_unregister(uda->proc_regs_entry);
-               uda->proc_regs_entry = NULL;
-       }
-       if (uda->proc_entry) {
-               snd_info_unregister(uda->proc_entry);
-               uda->proc_entry = NULL;
-       }
+       if (! snd_card_proc_new(card, "uda1341", &entry))
+               snd_info_set_text_ops(entry, clnt, snd_uda1341_proc_read);
+       if (! snd_card_proc_new(card, "uda1341-regs", &entry)) {
+               snd_info_set_text_ops(entry, clnt, snd_uda1341_proc_regs_read);
 }
 
 /* }}} */
@@ -731,7 +692,6 @@
 {
        DEBUG_NAME(KERN_DEBUG "uda1341 mixer_del\n");
         
-       snd_uda1341_proc_done(uda1341);
        l3_detach_client(uda1341);
 
        snd_magic_kfree(uda1341);



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