patch-2.4.0-test5 linux/fs/devfs/base.c
Next file: linux/fs/devices.c
Previous file: linux/fs/dcache.c
Back to the patch index
Back to the overall index
- Lines: 30
- Date:
Mon Jul 24 17:04:12 2000
- Orig file:
v2.4.0-test4/linux/fs/devfs/base.c
- Orig date:
Fri Jul 14 12:12:14 2000
diff -u --recursive --new-file v2.4.0-test4/linux/fs/devfs/base.c linux/fs/devfs/base.c
@@ -1246,8 +1246,7 @@
}
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 @@
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;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)