From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Driver Core update and fixes for 2.6.1
Date: Mon, 19 Jan 2004 17:12:40 -0800 [thread overview]
Message-ID: <1074561160498@kroah.com> (raw)
In-Reply-To: <10745611602245@kroah.com>
ChangeSet 1.1501, 2004/01/19 16:40:57-08:00, greg@kroah.com
[PATCH] MEM: add sysfs class support for mem devices
This adds class/mem/ for all memory devices (random, raw, null, etc.)
drivers/char/mem.c | 7 +++++++
1 files changed, 7 insertions(+)
diff -Nru a/drivers/char/mem.c b/drivers/char/mem.c
--- a/drivers/char/mem.c Mon Jan 19 17:04:57 2004
+++ b/drivers/char/mem.c Mon Jan 19 17:04:57 2004
@@ -24,6 +24,7 @@
#include <linux/smp_lock.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/ptrace.h>
+#include <linux/device.h>
#include <asm/uaccess.h>
#include <asm/io.h>
@@ -676,6 +677,8 @@
{11,"kmsg", S_IRUGO | S_IWUSR, &kmsg_fops},
};
+static struct class_simple *mem_class;
+
static int __init chr_dev_init(void)
{
int i;
@@ -683,7 +686,11 @@
if (register_chrdev(MEM_MAJOR,"mem",&memory_fops))
printk("unable to get major %d for memory devs\n", MEM_MAJOR);
+ mem_class = class_simple_create(THIS_MODULE, "mem");
for (i = 0; i < ARRAY_SIZE(devlist); i++) {
+ class_simple_device_add(mem_class,
+ MKDEV(MEM_MAJOR, devlist[i].minor),
+ NULL, devlist[i].name);
devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor),
S_IFCHR | devlist[i].mode, devlist[i].name);
}
next prev parent reply other threads:[~2004-01-20 1:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-20 1:10 [BK PATCH] Driver Core update for 2.6.1 Greg KH
2004-01-20 1:12 ` [PATCH] Driver Core update and fixes " Greg KH
2004-01-20 1:12 ` Greg KH
2004-01-20 1:12 ` Greg KH
2004-01-20 1:12 ` Greg KH
2004-01-20 1:12 ` Greg KH
2004-01-20 1:12 ` Greg KH
2004-01-20 1:12 ` Greg KH [this message]
2004-01-20 1:12 ` Greg KH
2004-01-20 1:12 ` Greg KH
2004-01-20 1:12 ` Greg KH
2004-01-20 1:12 ` Greg KH
2004-01-20 8:40 ` [BK PATCH] Driver Core update " Måns Rullgård
2004-01-20 11:13 ` Andreas Jellinghaus
2004-01-20 17:14 ` Greg KH
2004-01-20 17:48 ` Måns Rullgård
2004-01-21 0:10 ` Greg KH
2004-01-21 1:59 ` Måns Rullgård
2004-01-21 2:18 ` Greg KH
2004-01-21 18:39 ` Måns Rullgård
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=1074561160498@kroah.com \
--to=greg@kroah.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