Use proc_create_data to properly pass along data.

This commit is contained in:
Ole Petter Bang 2013-12-02 22:03:25 +01:00
parent c84bc550e8
commit 558835015b

View File

@ -323,12 +323,10 @@ static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
read_proc_t *read_proc, void * data)
{
struct file_operations fops = {
owner: THIS_MODULE,
read: read_proc
};
struct proc_dir_entry *res = proc_create(name, mode, base, &fops);
//if (res) {
// res->data = data;
//}
struct proc_dir_entry *res = proc_create_data(name, mode, base, &fops, data);
return res;
}
typedef ssize_t (*write_proc_t) (struct file *, const char __user *, ssize_t, loff_t *);
@ -337,13 +335,11 @@ static inline struct proc_dir_entry *create_proc_read_write_entry(const char *na
read_proc_t *read_proc, void * data, write_proc_t *write_proc)
{
struct file_operations fops = {
owner: THIS_MODULE,
read: read_proc,
write: write_proc
};
struct proc_dir_entry *res = proc_create(name, mode, base, &fops);
//if (res) {
// res->data = data;
//}
struct proc_dir_entry *res = proc_create_data(name, mode, base, &fops, data);
return res;
}
#endif