[dahdi-commits] sruffell: linux/trunk r5175 - /linux/trunk/drivers/dahdi/wcb4xxp/base.c
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Wed Oct 29 11:48:34 CDT 2008
Author: sruffell
Date: Wed Oct 29 11:48:33 2008
New Revision: 5175
URL: http://svn.digium.com/view/dahdi?view=rev&rev=5175
Log:
The /proc/wcb4xxp should not be created once for each card but rather once for
all cards.
Modified:
linux/trunk/drivers/dahdi/wcb4xxp/base.c
Modified: linux/trunk/drivers/dahdi/wcb4xxp/base.c
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/wcb4xxp/base.c?view=diff&rev=5175&r1=5174&r2=5175
==============================================================================
--- linux/trunk/drivers/dahdi/wcb4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcb4xxp/base.c Wed Oct 29 11:48:33 2008
@@ -92,9 +92,8 @@
20, 18, 16, 13, 11, 9, 8, 6, 4, 3, 2, 1, 0, 0,
};
-// #undef CREATE_WCB4XXP_PROCFS_ENTRY
+// #define CREATE_WCB4XXP_PROCFS_ENTRY
#ifdef CREATE_WCB4XXP_PROCFS_ENTRY
-#define PROCFS_MAX_SIZE 1024
#define PROCFS_NAME "wcb4xxp"
static struct proc_dir_entry *myproc;
#endif
@@ -2337,9 +2336,7 @@
len = sprintf(buf, "%s\n%s\nTicks: %ld\n", sBuf, str, b4->ticks);
return len;
}
-#endif
-
-#ifdef CREATE_WCB4XXP_PROCFS_ENTRY
+
static int b4xxp_proc_read(char *buf, char **start, off_t offset, int count, int *eof, void *data)
{
struct b4xxp **b4_cards = data;
@@ -2380,7 +2377,7 @@
*eof = 1;
return len;
}
-#endif
+#endif /* CREATE_WCB4XXP_PROCFS_ENTRY */
static int __devinit b4xx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -2494,21 +2491,6 @@
}
}
-#ifdef CREATE_WCB4XXP_PROCFS_ENTRY
- if(!(myproc = create_proc_entry(PROCFS_NAME, 0444, NULL))) {
- remove_proc_entry(PROCFS_NAME, &proc_root);
- dev_err(b4->dev, "Error: Could not initialize /proc/%s\n", PROCFS_NAME);
- goto err_out_unreg_spans;
- }
-
- myproc->read_proc = b4xxp_proc_read;
- myproc->data = cards;
- myproc->owner = THIS_MODULE;
- myproc->mode = S_IFREG | S_IRUGO;
- myproc->uid = 0;
- myproc->gid = 0;
- myproc->size = 37;
-#endif
#if 0
/* Launch cards as appropriate */
@@ -2584,9 +2566,6 @@
dahdi_unregister(&b4->spans[i].span);
}
-#ifdef CREATE_WCB4XXP_PROCFS_ENTRY
- remove_proc_entry(PROCFS_NAME, &proc_root);
-#endif
b4xxp_init_stage1(b4);
free_irq(pdev->irq, b4);
pci_set_drvdata(pdev, NULL);
@@ -2622,6 +2601,13 @@
static int __init b4xx_init(void)
{
+
+#ifdef CREATE_WCB4XXP_PROCFS_ENTRY
+ if(!(myproc = create_proc_read_entry(PROCFS_NAME, 0444, NULL,
+ b4xxp_proc_read, cards))) {
+ printk(KERN_ERR "%s: ERROR: Could not initialize /proc/%s\n",THIS_MODULE->name, PROCFS_NAME);
+ }
+#endif
if(dahdi_pci_module(&b4xx_driver))
return -ENODEV;
@@ -2630,6 +2616,9 @@
static void __exit b4xx_exit(void)
{
+#ifdef CREATE_WCB4XXP_PROCFS_ENTRY
+ remove_proc_entry(PROCFS_NAME, NULL);
+#endif
pci_unregister_driver(&b4xx_driver);
}
More information about the dahdi-commits
mailing list