Update of /cvsroot/alsa/alsa-kernel/pci/rme9652
In directory sc8-pr-cvs1:/tmp/cvs-serv6295/pci/rme9652
Modified Files:
hdsp.c rme9652.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: hdsp.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/rme9652/hdsp.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- hdsp.c 2 Dec 2002 11:36:42 -0000 1.15
+++ hdsp.c 7 Jan 2003 10:36:32 -0000 1.16
@@ -368,7 +368,6 @@
snd_card_t *card;
snd_pcm_t *pcm;
struct pci_dev *pci;
- snd_info_entry_t *proc_entry;
snd_kcontrol_t *spdif_ctl;
unsigned short mixer_matrix[HDSP_MATRIX_MIXER_SIZE];
};
@@ -2076,27 +2075,8 @@
{
snd_info_entry_t *entry;
- if ((entry = snd_info_create_card_entry(hdsp->card, "hdsp",
hdsp->card->proc_root)) !=
- NULL) {
- entry->content = SNDRV_INFO_CONTENT_TEXT;
- entry->private_data = hdsp;
- entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
- entry->c.text.read_size = 256;
- entry->c.text.read = snd_hdsp_proc_read;
- if (snd_info_register(entry) < 0) {
- snd_info_free_entry(entry);
- entry = NULL;
- }
- }
- hdsp->proc_entry = entry;
-}
-
-static void snd_hdsp_proc_done(hdsp_t *hdsp)
-{
- if (hdsp->proc_entry) {
- snd_info_unregister(hdsp->proc_entry);
- hdsp->proc_entry = NULL;
- }
+ if (! snd_card_proc_new(hdsp->card, "hdsp", &entry))
+ snd_info_set_text_ops(entry, hdsp, snd_hdsp_proc_read);
}
static void snd_hdsp_free_buffers(hdsp_t *hdsp)
@@ -3078,7 +3058,6 @@
if (hdsp->irq >= 0)
free_irq(hdsp->irq, (void *)hdsp);
- snd_hdsp_proc_done(hdsp);
snd_hdsp_free_buffers(hdsp);
if (hdsp->iobase)
Index: rme9652.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/rme9652/rme9652.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- rme9652.c 2 Dec 2002 16:58:09 -0000 1.26
+++ rme9652.c 7 Jan 2003 10:36:32 -0000 1.27
@@ -263,7 +263,6 @@
snd_card_t *card;
snd_pcm_t *pcm;
struct pci_dev *pci;
- snd_info_entry_t *proc_entry;
snd_kcontrol_t *spdif_ctl;
} rme9652_t;
@@ -1803,27 +1802,8 @@
{
snd_info_entry_t *entry;
- if ((entry = snd_info_create_card_entry(rme9652->card, "rme9652",
rme9652->card->proc_root)) !=
- NULL) {
- entry->content = SNDRV_INFO_CONTENT_TEXT;
- entry->private_data = rme9652;
- entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
- entry->c.text.read_size = 256;
- entry->c.text.read = snd_rme9652_proc_read;
- if (snd_info_register(entry) < 0) {
- snd_info_free_entry(entry);
- entry = NULL;
- }
- }
- rme9652->proc_entry = entry;
-}
-
-static void snd_rme9652_proc_done(rme9652_t *rme9652)
-{
- if (rme9652->proc_entry) {
- snd_info_unregister(rme9652->proc_entry);
- rme9652->proc_entry = NULL;
- }
+ if (! snd_card_proc_new(rme9652->card, "rme9652", &entry))
+ snd_info_set_text_ops(entry, rme9652, snd_rme9652_proc_read);
}
static void snd_rme9652_free_buffers(rme9652_t *rme9652)
@@ -1855,7 +1835,6 @@
{
if (rme9652->irq >= 0)
rme9652_stop(rme9652);
- snd_rme9652_proc_done(rme9652);
snd_rme9652_free_buffers(rme9652);
if (rme9652->iobase)
-------------------------------------------------------
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