aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-07-10 10:01:26 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-07-10 10:01:26 -0700
commit5ad9cb65e9b15e5b83e2dd1c10a4bcaccc4ec644 (patch)
tree5b2a7bbacb536a3486d7931ef7ee44fe63febcba
parentca2a459cd7d29d5d79a71f6a415e3baed8865e50 (diff)
downloadhistory-5ad9cb65e9b15e5b83e2dd1c10a4bcaccc4ec644.tar.gz
[PATCH] remove proc_mknod()
From: Christoph Hellwig <hch@lst.de> It's not used anymore since ALSA switched to traditional devices and device nodes in procfs are a bad idea in general.. Also update the docs.
-rw-r--r--Documentation/DocBook/procfs-guide.tmpl35
-rw-r--r--Documentation/DocBook/procfs_example.c12
-rw-r--r--fs/proc/generic.c16
-rw-r--r--fs/proc/inode.c2
-rw-r--r--fs/proc/root.c1
-rw-r--r--include/linux/proc_fs.h5
6 files changed, 1 insertions, 70 deletions
diff --git a/Documentation/DocBook/procfs-guide.tmpl b/Documentation/DocBook/procfs-guide.tmpl
index 1929db973f993..669b0466a7015 100644
--- a/Documentation/DocBook/procfs-guide.tmpl
+++ b/Documentation/DocBook/procfs-guide.tmpl
@@ -253,41 +253,6 @@
</para>
</sect1>
-
-
-
- <sect1>
- <title>Creating a device</title>
-
- <funcsynopsis>
- <funcprototype>
- <funcdef>struct proc_dir_entry* <function>proc_mknod</function></funcdef>
- <paramdef>const char* <parameter>name</parameter></paramdef>
- <paramdef>mode_t <parameter>mode</parameter></paramdef>
- <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef>
- <paramdef>kdev_t <parameter>rdev</parameter></paramdef>
- </funcprototype>
- </funcsynopsis>
-
- <para>
- Creates a device file <parameter>name</parameter> with mode
- <parameter>mode</parameter> in the procfs directory
- <parameter>parent</parameter>. The device file will work on
- the device <parameter>rdev</parameter>, which can be generated
- by using the <literal>MKDEV</literal> macro from
- <literal>linux/kdev_t.h</literal>. The
- <parameter>mode</parameter> parameter
- <emphasis>must</emphasis> contain <constant>S_IFBLK</constant>
- or <constant>S_IFCHR</constant> to create a device
- node. Compare with userland <literal>mknod
- --mode=</literal><parameter>mode</parameter>
- <parameter>name</parameter> <parameter>rdev</parameter>.
- </para>
- </sect1>
-
-
-
-
<sect1>
<title>Creating a directory</title>
diff --git a/Documentation/DocBook/procfs_example.c b/Documentation/DocBook/procfs_example.c
index baaaaa20fa528..bdf47034a831b 100644
--- a/Documentation/DocBook/procfs_example.c
+++ b/Documentation/DocBook/procfs_example.c
@@ -63,7 +63,7 @@ struct fb_data_t {
static struct proc_dir_entry *example_dir, *foo_file,
- *bar_file, *jiffies_file, *tty_device, *symlink;
+ *bar_file, *jiffies_file, *symlink;
struct fb_data_t foo_data, bar_data;
@@ -173,16 +173,6 @@ static int __init init_procfs_example(void)
bar_file->write_proc = proc_write_foobar;
bar_file->owner = THIS_MODULE;
- /* create tty device */
- tty_device = proc_mknod("tty", S_IFCHR | 0666,
- example_dir, MKDEV(5, 0));
- if(tty_device == NULL) {
- rv = -ENOMEM;
- goto no_tty;
- }
-
- tty_device->owner = THIS_MODULE;
-
/* create symlink */
symlink = proc_symlink("jiffies_too", example_dir,
"jiffies");
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 979237c72966e..5cfb0fcb45961 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -566,22 +566,6 @@ struct proc_dir_entry *proc_symlink(const char *name,
return ent;
}
-struct proc_dir_entry *proc_mknod(const char *name, mode_t mode,
- struct proc_dir_entry *parent, kdev_t rdev)
-{
- struct proc_dir_entry *ent;
-
- ent = proc_create(&parent,name,mode,1);
- if (ent) {
- ent->rdev = rdev;
- if (proc_register(parent, ent) < 0) {
- kfree(ent);
- ent = NULL;
- }
- }
- return ent;
-}
-
struct proc_dir_entry *proc_mkdir(const char *name, struct proc_dir_entry *parent)
{
struct proc_dir_entry *ent;
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index cc29f792f1495..807b5f6c4ee5b 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -204,8 +204,6 @@ printk("proc_iget: using deleted entry %s, count=%d\n", de->name, atomic_read(&d
inode->i_op = de->proc_iops;
if (de->proc_fops)
inode->i_fop = de->proc_fops;
- else if (S_ISBLK(de->mode)||S_ISCHR(de->mode)||S_ISFIFO(de->mode))
- init_special_inode(inode,de->mode,kdev_t_to_nr(de->rdev));
}
out:
diff --git a/fs/proc/root.c b/fs/proc/root.c
index 936962d01c28c..f338544e1687e 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -153,7 +153,6 @@ struct proc_dir_entry proc_root = {
EXPORT_SYMBOL(proc_sys_root);
#endif
EXPORT_SYMBOL(proc_symlink);
-EXPORT_SYMBOL(proc_mknod);
EXPORT_SYMBOL(proc_mkdir);
EXPORT_SYMBOL(create_proc_entry);
EXPORT_SYMBOL(remove_proc_entry);
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index e2e54ee6186d3..9054f5686f04b 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -71,7 +71,6 @@ struct proc_dir_entry {
write_proc_t *write_proc;
atomic_t count; /* use count */
int deleted; /* delete flag */
- kdev_t rdev;
};
struct kcore_list {
@@ -141,8 +140,6 @@ extern void proc_rtas_init(void);
extern struct proc_dir_entry *proc_symlink(const char *,
struct proc_dir_entry *, const char *);
-extern struct proc_dir_entry *proc_mknod(const char *,mode_t,
- struct proc_dir_entry *,kdev_t);
extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *);
static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
@@ -209,8 +206,6 @@ static inline struct proc_dir_entry *create_proc_entry(const char *name,
static inline struct proc_dir_entry *proc_symlink(const char *name,
struct proc_dir_entry *parent,char *dest) {return NULL;}
-static inline struct proc_dir_entry *proc_mknod(const char *name,mode_t mode,
- struct proc_dir_entry *parent,kdev_t rdev) {return NULL;}
static inline struct proc_dir_entry *proc_mkdir(const char *name,
struct proc_dir_entry *parent) {return NULL;}