mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Tom Reinhart" <rhino_tom@hotmail.com>
To: marcelo@conectiva.com.br
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.4.21pre7 make raw devices appear in devfs
Date: Sun, 06 Apr 2003 15:41:18 -0700	[thread overview]
Message-ID: <F63cltA05BqSyu3beYg0001c1c0@hotmail.com> (raw)

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


                 reply	other threads:[~2003-04-06 22:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F63cltA05BqSyu3beYg0001c1c0@hotmail.com \
    --to=rhino_tom@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®