summaryrefslogtreecommitdiffstats
path: root/fs/devfs
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-07-27 23:20:03 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-07-27 23:20:03 +0000
commit89eba5eb77bbf92ffed6686c951cc35f4027e71f (patch)
treeb56887b1753ca2573002bc7f60e5f3e47c33b116 /fs/devfs
parentf7ff3f5a67747c7714c3db772d05965a0c033705 (diff)
Merge with Linux 2.4.0-test5-pre5.
Diffstat (limited to 'fs/devfs')
-rw-r--r--fs/devfs/base.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index 38a773d72..ad28db63a 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -1246,8 +1246,7 @@ devfs_handle_t devfs_register (devfs_handle_t dir, const char *name,
}
if (ops == NULL)
{
- if ( S_ISCHR (mode) ) ops = get_chrfops (major, 0);
- else if ( S_ISBLK (mode) ) ops = (void *) get_blkfops (major);
+ if ( S_ISBLK (mode) ) ops = (void *) get_blkfops (major);
if (ops == NULL)
{
printk ("%s: devfs_register(%s): NULL ops pointer\n",
@@ -2506,6 +2505,19 @@ static int devfs_open (struct inode *inode, struct file *file)
else
{
/* Fallback to legacy scheme */
+ /*
+ * Do we need it? Richard, could you verify it?
+ * It can legitimately happen if
+ * it is a character device and
+ * df->ops == NULL and
+ * de->registered is true,
+ * but AFAICS it can't happen - in devfs_register() we never set
+ * ->ops to NULL, in unregister() we set ->registered to false,
+ * in devfs_mknod() we set it to NULL only if ->register is false.
+ *
+ * Looks like this fallback is not needed at all.
+ * AV
+ */
if ( S_ISCHR (inode->i_mode) ) err = chrdev_open (inode, file);
else err = -ENODEV;
}