Linux nnpfs devfs patch

Per Olofsson pelle at dsv.su.se
Sat Mar 8 14:03:04 CET 2003


Under Linux, if nnpfs is compiled with devfs support, it doesn't
register a legacy chrdev. This is a problem, because currently many
people don't use devfs even though the kernel was compiled with
support for it. AFAIK, almost all other kernel modules register both
types. I have attached a patch that fixes this.

/Pelle


Index: nnpfs/linux/nnpfs_load.c
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/linux/nnpfs_load.c,v
retrieving revision 1.28
diff -u -r1.28 nnpfs_load.c
--- nnpfs/linux/nnpfs_load.c	2002/09/07 10:47:01	1.28
+++ nnpfs/linux/nnpfs_load.c	2003/03/08 12:38:31
@@ -104,6 +104,12 @@
 		       NULL);		/* void *info */
 #endif
     if (nnpfs_devfs_handle == NULL) {
+	NNPFSDEB(XDEBVFOPS, ("nnpfs: unable to register devfs device nnpfs0\n"));
+	unregister_filesystem(&nnpfs_fs_type);
+	return -EIO;
+    }
+
+    if (devfs_register_chrdev(NNPFS_MAJOR,"nnpfs",&nnpfs_fops)) {
 #else
     if (register_chrdev(NNPFS_MAJOR,"nnpfs",&nnpfs_fops)) {
 #endif





More information about the Arla-drinkers mailing list