Commit 5ad9cb65 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[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.
parent ca2a459c
...@@ -253,41 +253,6 @@ ...@@ -253,41 +253,6 @@
</para> </para>
</sect1> </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> <sect1>
<title>Creating a directory</title> <title>Creating a directory</title>
......
...@@ -63,7 +63,7 @@ struct fb_data_t { ...@@ -63,7 +63,7 @@ struct fb_data_t {
static struct proc_dir_entry *example_dir, *foo_file, 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; struct fb_data_t foo_data, bar_data;
...@@ -173,16 +173,6 @@ static int __init init_procfs_example(void) ...@@ -173,16 +173,6 @@ static int __init init_procfs_example(void)
bar_file->write_proc = proc_write_foobar; bar_file->write_proc = proc_write_foobar;
bar_file->owner = THIS_MODULE; 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 */ /* create symlink */
symlink = proc_symlink("jiffies_too", example_dir, symlink = proc_symlink("jiffies_too", example_dir,
"jiffies"); "jiffies");
......
...@@ -566,22 +566,6 @@ struct proc_dir_entry *proc_symlink(const char *name, ...@@ -566,22 +566,6 @@ struct proc_dir_entry *proc_symlink(const char *name,
return ent; 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 *proc_mkdir(const char *name, struct proc_dir_entry *parent)
{ {
struct proc_dir_entry *ent; struct proc_dir_entry *ent;
......
...@@ -204,8 +204,6 @@ printk("proc_iget: using deleted entry %s, count=%d\n", de->name, atomic_read(&d ...@@ -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; inode->i_op = de->proc_iops;
if (de->proc_fops) if (de->proc_fops)
inode->i_fop = 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: out:
......
...@@ -153,7 +153,6 @@ struct proc_dir_entry proc_root = { ...@@ -153,7 +153,6 @@ struct proc_dir_entry proc_root = {
EXPORT_SYMBOL(proc_sys_root); EXPORT_SYMBOL(proc_sys_root);
#endif #endif
EXPORT_SYMBOL(proc_symlink); EXPORT_SYMBOL(proc_symlink);
EXPORT_SYMBOL(proc_mknod);
EXPORT_SYMBOL(proc_mkdir); EXPORT_SYMBOL(proc_mkdir);
EXPORT_SYMBOL(create_proc_entry); EXPORT_SYMBOL(create_proc_entry);
EXPORT_SYMBOL(remove_proc_entry); EXPORT_SYMBOL(remove_proc_entry);
......
...@@ -71,7 +71,6 @@ struct proc_dir_entry { ...@@ -71,7 +71,6 @@ struct proc_dir_entry {
write_proc_t *write_proc; write_proc_t *write_proc;
atomic_t count; /* use count */ atomic_t count; /* use count */
int deleted; /* delete flag */ int deleted; /* delete flag */
kdev_t rdev;
}; };
struct kcore_list { struct kcore_list {
...@@ -141,8 +140,6 @@ extern void proc_rtas_init(void); ...@@ -141,8 +140,6 @@ extern void proc_rtas_init(void);
extern struct proc_dir_entry *proc_symlink(const char *, extern struct proc_dir_entry *proc_symlink(const char *,
struct proc_dir_entry *, 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 *); 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, 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, ...@@ -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, static inline struct proc_dir_entry *proc_symlink(const char *name,
struct proc_dir_entry *parent,char *dest) {return NULL;} 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, static inline struct proc_dir_entry *proc_mkdir(const char *name,
struct proc_dir_entry *parent) {return NULL;} struct proc_dir_entry *parent) {return NULL;}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment