Commit b6e4a415 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN: CAPI: Remove unused capi_driver::driver_read_proc

In case a driver really wants to put some useful info into
/proc/capi/driver, it could create the proc entry directly.
parent 9c7166ef
...@@ -515,26 +515,6 @@ EXPORT_SYMBOL(detach_capi_ctr); ...@@ -515,26 +515,6 @@ EXPORT_SYMBOL(detach_capi_ctr);
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/* fallback if no driver read_proc function defined by driver */
static int driver_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
struct capi_driver *driver = (struct capi_driver *)data;
int len = 0;
len += sprintf(page+len, "%-16s %s\n", "name", driver->name);
len += sprintf(page+len, "%-16s %s\n", "revision", driver->revision);
if (len < off)
return 0;
*eof = 1;
*start = page + off;
return ((count < len-off) ? count : len-off);
}
/* ------------------------------------------------------------- */
void attach_capi_driver(struct capi_driver *driver) void attach_capi_driver(struct capi_driver *driver)
{ {
INIT_LIST_HEAD(&driver->contr_head); INIT_LIST_HEAD(&driver->contr_head);
...@@ -544,18 +524,6 @@ void attach_capi_driver(struct capi_driver *driver) ...@@ -544,18 +524,6 @@ void attach_capi_driver(struct capi_driver *driver)
spin_unlock(&capi_drivers_lock); spin_unlock(&capi_drivers_lock);
printk(KERN_NOTICE "kcapi: driver %s attached\n", driver->name); printk(KERN_NOTICE "kcapi: driver %s attached\n", driver->name);
sprintf(driver->procfn, "capi/drivers/%s", driver->name);
driver->procent = create_proc_entry(driver->procfn, 0, 0);
if (driver->procent) {
if (driver->driver_read_proc) {
driver->procent->read_proc =
(int (*)(char *,char **,off_t,int,int *,void *))
driver->driver_read_proc;
} else {
driver->procent->read_proc = driver_read_proc;
}
driver->procent->data = driver;
}
} }
EXPORT_SYMBOL(attach_capi_driver); EXPORT_SYMBOL(attach_capi_driver);
...@@ -567,10 +535,6 @@ void detach_capi_driver(struct capi_driver *driver) ...@@ -567,10 +535,6 @@ void detach_capi_driver(struct capi_driver *driver)
spin_unlock(&capi_drivers_lock); spin_unlock(&capi_drivers_lock);
printk(KERN_NOTICE "kcapi: driver %s detached\n", driver->name); printk(KERN_NOTICE "kcapi: driver %s detached\n", driver->name);
if (driver->procent) {
remove_proc_entry(driver->procfn, 0);
driver->procent = 0;
}
} }
EXPORT_SYMBOL(detach_capi_driver); EXPORT_SYMBOL(detach_capi_driver);
......
...@@ -160,7 +160,6 @@ static struct capi_driver b1isa_driver = { ...@@ -160,7 +160,6 @@ static struct capi_driver b1isa_driver = {
procinfo: b1isa_procinfo, procinfo: b1isa_procinfo,
ctr_read_proc: b1ctl_read_proc, ctr_read_proc: b1ctl_read_proc,
driver_read_proc: 0, /* use standard driver_read_proc */
}; };
#define MAX_CARDS 4 #define MAX_CARDS 4
......
...@@ -167,7 +167,6 @@ static struct capi_driver b1pci_driver = { ...@@ -167,7 +167,6 @@ static struct capi_driver b1pci_driver = {
procinfo: b1pci_procinfo, procinfo: b1pci_procinfo,
ctr_read_proc: b1ctl_read_proc, ctr_read_proc: b1ctl_read_proc,
driver_read_proc: 0, /* use standard driver_read_proc */
}; };
#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4 #ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
...@@ -318,7 +317,6 @@ static struct capi_driver b1pciv4_driver = { ...@@ -318,7 +317,6 @@ static struct capi_driver b1pciv4_driver = {
procinfo: b1pciv4_procinfo, procinfo: b1pciv4_procinfo,
ctr_read_proc: b1dmactl_read_proc, ctr_read_proc: b1dmactl_read_proc,
driver_read_proc: 0, /* use standard driver_read_proc */
}; };
#endif /* CONFIG_ISDN_DRV_AVMB1_B1PCIV4 */ #endif /* CONFIG_ISDN_DRV_AVMB1_B1PCIV4 */
......
...@@ -154,7 +154,6 @@ static struct capi_driver b1pcmcia_driver = { ...@@ -154,7 +154,6 @@ static struct capi_driver b1pcmcia_driver = {
procinfo: b1pcmcia_procinfo, procinfo: b1pcmcia_procinfo,
ctr_read_proc: b1ctl_read_proc, ctr_read_proc: b1ctl_read_proc,
driver_read_proc: 0, /* use standard driver_read_proc */
}; };
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
......
...@@ -1216,7 +1216,6 @@ static struct capi_driver c2_driver = { ...@@ -1216,7 +1216,6 @@ static struct capi_driver c2_driver = {
procinfo: c4_procinfo, procinfo: c4_procinfo,
ctr_read_proc: c4_read_proc, ctr_read_proc: c4_read_proc,
driver_read_proc: 0, /* use standard driver_read_proc */
}; };
static struct capi_driver c4_driver = { static struct capi_driver c4_driver = {
...@@ -1231,7 +1230,6 @@ static struct capi_driver c4_driver = { ...@@ -1231,7 +1230,6 @@ static struct capi_driver c4_driver = {
procinfo: c4_procinfo, procinfo: c4_procinfo,
ctr_read_proc: c4_read_proc, ctr_read_proc: c4_read_proc,
driver_read_proc: 0, /* use standard driver_read_proc */
}; };
static int __devinit c4_probe(struct pci_dev *dev, static int __devinit c4_probe(struct pci_dev *dev,
......
...@@ -497,7 +497,6 @@ static struct capi_driver t1isa_driver = { ...@@ -497,7 +497,6 @@ static struct capi_driver t1isa_driver = {
procinfo: t1isa_procinfo, procinfo: t1isa_procinfo,
ctr_read_proc: b1ctl_read_proc, ctr_read_proc: b1ctl_read_proc,
driver_read_proc: 0, /* use standard driver_read_proc */
}; };
#define MAX_CARDS 4 #define MAX_CARDS 4
......
...@@ -191,7 +191,6 @@ static struct capi_driver t1pci_driver = { ...@@ -191,7 +191,6 @@ static struct capi_driver t1pci_driver = {
procinfo: t1pci_procinfo, procinfo: t1pci_procinfo,
ctr_read_proc: b1dmactl_read_proc, ctr_read_proc: b1dmactl_read_proc,
driver_read_proc: 0, /* use standard driver_read_proc */
}; };
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
......
...@@ -699,7 +699,6 @@ static struct capi_driver hycapi_driver = { ...@@ -699,7 +699,6 @@ static struct capi_driver hycapi_driver = {
procinfo: hycapi_procinfo, procinfo: hycapi_procinfo,
ctr_read_proc: hycapi_read_proc, ctr_read_proc: hycapi_read_proc,
driver_read_proc: 0, /* use standard driver_read_proc */
}; };
......
...@@ -88,15 +88,11 @@ struct capi_driver { ...@@ -88,15 +88,11 @@ struct capi_driver {
char *(*procinfo)(struct capi_ctr *); char *(*procinfo)(struct capi_ctr *);
int (*ctr_read_proc)(char *page, char **start, off_t off, int (*ctr_read_proc)(char *page, char **start, off_t off,
int count, int *eof, struct capi_ctr *card); int count, int *eof, struct capi_ctr *card);
int (*driver_read_proc)(char *page, char **start, off_t off,
int count, int *eof, struct capi_driver *driver);
/* intitialized by kcapi */ /* intitialized by kcapi */
struct list_head contr_head; /* list of controllers */ struct list_head contr_head; /* list of controllers */
struct list_head driver_list; struct list_head driver_list;
int ncontroller; int ncontroller;
struct proc_dir_entry *procent;
char procfn[128];
}; };
void attach_capi_driver(struct capi_driver *driver); void attach_capi_driver(struct capi_driver *driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment