Commit 0056b34a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] raw.c devfs support

From: Andrey Borzenkov <arvidjaar@mail.ru>

Add devfs support to raw.c.
parent 1327ca85
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -258,12 +259,27 @@ static struct file_operations raw_ctl_fops = { ...@@ -258,12 +259,27 @@ static struct file_operations raw_ctl_fops = {
static int __init raw_init(void) static int __init raw_init(void)
{ {
int i;
register_chrdev(RAW_MAJOR, "raw", &raw_fops); register_chrdev(RAW_MAJOR, "raw", &raw_fops);
devfs_mk_cdev(MKDEV(RAW_MAJOR, 0),
S_IFCHR | S_IRUGO | S_IWUGO,
"raw/rawctl");
for (i = 1; i < MAX_RAW_MINORS; i++)
devfs_mk_cdev(MKDEV(RAW_MAJOR, i),
S_IFCHR | S_IRUGO | S_IWUGO,
"raw/raw%d", i);
return 0; return 0;
} }
static void __exit raw_exit(void) static void __exit raw_exit(void)
{ {
int i;
for (i = 1; i < MAX_RAW_MINORS; i++)
devfs_remove("raw/raw%d", i);
devfs_remove("raw/rawctl");
devfs_remove("raw");
unregister_chrdev(RAW_MAJOR, "raw"); unregister_chrdev(RAW_MAJOR, "raw");
} }
......
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