Commit 4ca112a6 authored by Albert Cranford's avatar Albert Cranford Committed by Linus Torvalds

[PATCH] 2.5.33 i2c-proc.c remove inode_fill code

My previous patch added procs i2c_fill_inode and i2c_dir_fill_inode that
Al Viro deemed unnecessary.  i2c developers are in contact with Al to
get the latest scoop.  Meantime lets reverse the change before he flies
off at me about procfs abuse.
parent 1114b497
...@@ -60,7 +60,6 @@ int __init sensors_init(void); ...@@ -60,7 +60,6 @@ int __init sensors_init(void);
static struct ctl_table_header *i2c_entries[SENSORS_ENTRY_MAX]; static struct ctl_table_header *i2c_entries[SENSORS_ENTRY_MAX];
static struct i2c_client *i2c_clients[SENSORS_ENTRY_MAX]; static struct i2c_client *i2c_clients[SENSORS_ENTRY_MAX];
static unsigned short i2c_inodes[SENSORS_ENTRY_MAX];
static ctl_table sysctl_table[] = { static ctl_table sysctl_table[] = {
{CTL_DEV, "dev", NULL, 0, 0555}, {CTL_DEV, "dev", NULL, 0, 0555},
...@@ -189,8 +188,6 @@ int i2c_register_entry(struct i2c_client *client, const char *prefix, ...@@ -189,8 +188,6 @@ int i2c_register_entry(struct i2c_client *client, const char *prefix,
return id; return id;
} }
#endif /* DEBUG */ #endif /* DEBUG */
i2c_inodes[id - 256] =
new_header->ctl_table->child->child->de->low_ino;
new_header->ctl_table->child->child->de->owner = controlling_mod; new_header->ctl_table->child->child->de->owner = controlling_mod;
return id; return id;
...@@ -213,49 +210,6 @@ void i2c_deregister_entry(int id) ...@@ -213,49 +210,6 @@ void i2c_deregister_entry(int id)
} }
} }
/* Monitor access for /proc/sys/dev/sensors; make unloading i2c-proc.o
impossible if some process still uses it or some file in it */
void i2c_fill_inode(struct inode *inode, int fill)
{
if (fill)
MOD_INC_USE_COUNT;
else
MOD_DEC_USE_COUNT;
}
/* Monitor access for /proc/sys/dev/sensors/ directories; make unloading
the corresponding module impossible if some process still uses it or
some file in it */
void i2c_dir_fill_inode(struct inode *inode, int fill)
{
int i;
struct i2c_client *client;
#ifdef DEBUG
if (!inode) {
printk(KERN_ERR "i2c-proc.o: Warning: inode NULL in fill_inode()\n");
return;
}
#endif /* def DEBUG */
for (i = 0; i < SENSORS_ENTRY_MAX; i++)
if (i2c_clients[i]
&& (i2c_inodes[i] == inode->i_ino)) break;
#ifdef DEBUG
if (i == SENSORS_ENTRY_MAX) {
printk
(KERN_ERR "i2c-proc.o: Warning: inode (%ld) not found in fill_inode()\n",
inode->i_ino);
return;
}
#endif /* def DEBUG */
client = i2c_clients[i];
if (fill)
client->driver->inc_use(client);
else
client->driver->dec_use(client);
}
int i2c_proc_chips(ctl_table * ctl, int write, struct file *filp, int i2c_proc_chips(ctl_table * ctl, int write, struct file *filp,
void *buffer, size_t * lenp) void *buffer, size_t * lenp)
{ {
......
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