From: Andrey Borzenkov Add devfs support to raw.c. drivers/char/raw.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) diff -puN drivers/char/raw.c~raw-devfs-support drivers/char/raw.c --- 25/drivers/char/raw.c~raw-devfs-support 2003-06-16 15:36:24.000000000 -0700 +++ 25-akpm/drivers/char/raw.c 2003-06-16 15:36:24.000000000 -0700 @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -258,12 +259,27 @@ static struct file_operations raw_ctl_fo static int __init raw_init(void) { + int i; + 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; } 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"); } _