public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@mail.ru>
To: linux-kernel@vger.kernel.org
Cc: devfs@oss.sgi.com
Subject: [PATCH] 2.5.70: raw.c devfs support
Date: Sun, 15 Jun 2003 20:18:52 +0400	[thread overview]
Message-ID: <200306152018.52602.arvidjaar@mail.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 123 bytes --]

Trivial patch to add devfs support to raw.c. Similar patch has been posted for 
2.4 but apparently never applied.

-andrey

[-- Attachment #2: 2.5.70-raw.devfs.patch --]
[-- Type: text/x-diff, Size: 972 bytes --]

--- linux-2.5.70/drivers/char/raw.c.devfs	2003-06-01 11:49:51.000000000 +0400
+++ linux-2.5.70/drivers/char/raw.c	2003-06-15 19:23:20.000000000 +0400
@@ -10,6 +10,7 @@
 
 #include <linux/init.h>
 #include <linux/fs.h>
+#include <linux/devfs_fs_kernel.h>
 #include <linux/major.h>
 #include <linux/blkdev.h>
 #include <linux/module.h>
@@ -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 = 0; 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 = 0; i < MAX_RAW_MINORS; i++)
+		devfs_remove("raw/raw%d", i);
+	devfs_remove("raw/rawctl");
+	devfs_remove("raw");
 	unregister_chrdev(RAW_MAJOR, "raw");
 }
 

                 reply	other threads:[~2003-06-15 16:05 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=200306152018.52602.arvidjaar@mail.ru \
    --to=arvidjaar@mail.ru \
    --cc=devfs@oss.sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    /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