devfs patch for linux 2.6 (2.0.1-pre2)

Gregory Hinton Nietsky <[email protected]>
Newsgroups gmane.linux.dazuko.devel
Message-ID <[email protected]>
--- dazuko_linux26.c    Wed Mar 24 22:16:34 2004
+++ dazuko_linux26.c.greg       Fri Mar 26 12:09:41 2004
@@ -31,6 +31,10 @@
 #include <linux/dcache.h>
 #include <linux/mount.h>

+#ifdef CONFIG_DEVFS_FS
+#include <linux/devfs_fs_kernel.h>
+#endif
+
 ssize_t linux_dazuko_device_read(struct file *, char __user *, size_t, 
loff_t *);
 ssize_t linux_dazuko_device_write(struct file *, const char __user *, 
size_t, loff_t *);
 int linux_dazuko_device_open(struct inode *, struct file *);
@@ -605,7 +609,9 @@
        }

        /* initialization complete */
-
+#ifdef CONFIG_DEVFS_FS
+        devfs_mk_cdev(MKDEV(dev_major, 0), S_IFCHR | S_IRUSR | 
S_IWUSR,"%s",DEVICE_NAME);
+#endif
        return 0;
 }

@@ -623,6 +629,10 @@
                mod_unreg_security(DEVICE_NAME, &dazuko_ops);
        else
                unregister_security(&dazuko_ops);
+
+#ifdef CONFIG_DEVFS_FS
+        devfs_remove("%s",DEVICE_NAME);
+#endif

        return 0;
 }

--
This message has been scanned for viruses and
dangerous content by Network Sentry, and is
believed to be clean.
http://www.networksentry.co.za
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.