--- linux-2.4.17-wt8/drivers/net/wan/comx.c-orig Sun Feb 17 01:48:57 2002 +++ linux-2.4.17-wt8/drivers/net/wan/comx.c Sun Feb 17 02:49:59 2002 @@ -94,23 +94,15 @@ static int comx_mkdir(struct inode *, struct dentry *, int); static int comx_rmdir(struct inode *, struct dentry *); -static struct dentry *comx_lookup(struct inode *, struct dentry *); static struct inode_operations comx_root_inode_ops = { - lookup: comx_lookup, mkdir: comx_mkdir, rmdir: comx_rmdir, }; -static int comx_delete_dentry(struct dentry *dentry); static struct proc_dir_entry *create_comx_proc_entry(char *name, int mode, int size, struct proc_dir_entry *dir); -static struct dentry_operations comx_dentry_operations = { - d_delete: comx_delete_dentry, -}; - - static struct proc_dir_entry * comx_root_dir; struct comx_debugflags_struct comx_debugflags[] = { @@ -923,31 +915,6 @@ return 0; } -static struct dentry *comx_lookup(struct inode *dir, struct dentry *dentry) -{ - struct proc_dir_entry *de; - struct inode *inode = NULL; - - if ((de = (struct proc_dir_entry *) dir->u.generic_ip) != NULL) { - for (de = de->subdir ; de ; de = de->next) { - if ((de && de->low_ino) && - (de->namelen == dentry->d_name.len) && - (memcmp(dentry->d_name.name, de->name, - de->namelen) == 0)) { - if ((inode = proc_get_inode(dir->i_sb, - de->low_ino, de)) == NULL) { - printk(KERN_ERR "COMX: lookup error\n"); - return ERR_PTR(-EINVAL); - } - break; - } - } - } - dentry->d_op = &comx_dentry_operations; - d_add(dentry, inode); - return NULL; -} - int comx_strcasecmp(const char *cs, const char *ct) { register signed char __res; @@ -960,11 +927,6 @@ return __res; } -static int comx_delete_dentry(struct dentry *dentry) -{ - return 1; -} - static struct proc_dir_entry *create_comx_proc_entry(char *name, int mode, int size, struct proc_dir_entry *dir) { @@ -1080,6 +1042,8 @@ S_IFDIR | S_IWUSR | S_IRUGO | S_IXUGO, &proc_root); if (!comx_root_dir) return -ENOMEM; + /* take the lookup function from the initializd proc_iops */ + comx_root_inode_ops.lookup = comx_root_dir->proc_iops->lookup; comx_root_dir->proc_iops = &comx_root_inode_ops; if ((new_file = create_proc_entry(FILENAME_HARDWARELIST,