Source
44
44
/* Nothing to do */
45
45
}
46
46
47
47
static const struct seq_operations devinfo_ops = {
48
48
.start = devinfo_start,
49
49
.next = devinfo_next,
50
50
.stop = devinfo_stop,
51
51
.show = devinfo_show
52
52
};
53
53
54
-
static int devinfo_open(struct inode *inode, struct file *filp)
55
-
{
56
-
return seq_open(filp, &devinfo_ops);
57
-
}
58
-
59
-
static const struct file_operations proc_devinfo_operations = {
60
-
.open = devinfo_open,
61
-
.read = seq_read,
62
-
.llseek = seq_lseek,
63
-
.release = seq_release,
64
-
};
65
-
66
54
static int __init proc_devices_init(void)
67
55
{
68
-
proc_create("devices", 0, NULL, &proc_devinfo_operations);
56
+
proc_create_seq("devices", 0, NULL, &devinfo_ops);
69
57
return 0;
70
58
}
71
59
fs_initcall(proc_devices_init);