mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] 2.4.21pre7 make raw devices appear in devfs
@ 2003-04-06 22:41 Tom Reinhart
  0 siblings, 0 replies; only message in thread
From: Tom Reinhart @ 2003-04-06 22:41 UTC (permalink / raw)
  To: marcelo; +Cc: linux-kernel

This short patch was originally posted a while back by someone else.  For 
the original post and patch, see:

http://www.cs.helsinki.fi/linux/linux-kernel/2001-24/0435.html

This fix makes the raw devices appear in devfs.  Its useful for DVD movie 
playback, among other things.

I've had this patch applied for 6 months running Gentoo Linux, and its still 
working fine for me in 2.4.21pre7 so I thought I'd bring your attention to 
it again.

Thanks,
Tom


--- drivers/char/raw.c.orig     2003-04-05 12:12:48.000000000 -0600
+++ drivers/char/raw.c  2003-04-05 12:14:14.000000000 -0600
@@ -15,6 +15,7 @@
#include <linux/raw.h>
#include <linux/capability.h>
#include <linux/smp_lock.h>
+#include <linux/devfs_fs_kernel.h>
#include <asm/uaccess.h>

#define dprintk(x...)
@@ -53,7 +54,23 @@
static int __init raw_init(void)
{
        int i;
-       register_chrdev(RAW_MAJOR, "raw", &raw_fops);
+       if (devfs_register_chrdev(RAW_MAJOR, "raw", &raw_fops) != 0) {
+               printk(KERN_ERR "Unable to get major device %d for raw block 
devices",
+               RAW_MAJOR);
+       } else {
+               /*
+                * Make a directory for raw devices to go in ...
+                */
+               devfs_mk_dir(NULL, "raw", NULL);
+
+               /*
+                * Make the "control" device node for raw devices ...
+                */
+               devfs_register(NULL, "rawctl", DEVFS_FL_DEFAULT,
+                       RAW_MAJOR, 0,
+                       S_IFCHR | S_IRUSR | S_IWUSR,
+                       &raw_fops, NULL);
+       }

        for (i = 0; i < 256; i++)
                init_MUTEX(&raw_devices[i].mutex);

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-06 22:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-06 22:41 [PATCH] 2.4.21pre7 make raw devices appear in devfs Tom Reinhart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®