summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-09-20 20:32:35 +0000
committerShaun Ruffell <sruffell@digium.com>2010-09-20 20:32:35 +0000
commit28a40441188d84e2f3670c295fcf5b985818ac38 (patch)
tree4e47b4d528594cac30e86c1d1dea4e69b45509e5
parent15f0778e3d3293297b03604af461ba0447cd6679 (diff)
dahdi: Embed the proc entries in struct dahdi_span.
Part of preparations for replacing the array of spans with a list of spans. Review: https://reviewboard.asterisk.org/r/905/ Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9354 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/dahdi-base.c9
-rw-r--r--include/dahdi/kernel.h4
2 files changed, 9 insertions, 4 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 5a5bec8..9343cdd 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -151,7 +151,7 @@ EXPORT_SYMBOL(dahdi_unregister_echocan_factory);
EXPORT_SYMBOL(dahdi_set_hpec_ioctl);
#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry *proc_entries[DAHDI_MAX_SPANS];
+static struct proc_dir_entry *root_proc_entry;
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
@@ -6026,8 +6026,9 @@ int dahdi_register(struct dahdi_span *span, int prefmaster)
{
char tempfile[17];
snprintf(tempfile, sizeof(tempfile), "dahdi/%d", span->spanno);
- proc_entries[span->spanno] = create_proc_read_entry(tempfile, 0444,
- NULL, dahdi_proc_read, (int *) (long) span->spanno);
+ span->proc_entry = create_proc_read_entry(tempfile, 0444,
+ NULL, dahdi_proc_read,
+ (int *) (long) span->spanno);
}
#endif
@@ -8729,7 +8730,7 @@ static int __init dahdi_init(void)
int res = 0;
#ifdef CONFIG_PROC_FS
- proc_entries[0] = proc_mkdir("dahdi", NULL);
+ root_proc_entry = proc_mkdir("dahdi", NULL);
#endif
if ((res = register_chrdev(DAHDI_MAJOR, "dahdi", &dahdi_fops))) {
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index 83d3732..305d19c 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -871,6 +871,10 @@ struct dahdi_span {
int watchcounter;
int watchstate;
#endif
+
+#ifdef CONFIG_PROC_FS
+ struct proc_dir_entry *proc_entry;
+#endif
};
struct dahdi_transcoder_channel {