mtd/drivers/mtd mtdchar.c,1.53,1.54
David Woodhouse
dwmw2 at infradead.org
Wed May 21 06:50:45 EDT 2003
Update of /home/cvs/mtd/drivers/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv14837
Modified Files:
mtdchar.c
Log Message:
Clean up devfs ifdefs a little
Index: mtdchar.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/mtdchar.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- mtdchar.c 20 May 2003 21:50:03 -0000 1.53
+++ mtdchar.c 21 May 2003 10:50:43 -0000 1.54
@@ -2,7 +2,6 @@
* $Id$
*
* Character-device access to raw MTD devices.
- * Pure 2.4 version - compatibility cruft removed to mtdchar-compat.c
*
*/
@@ -462,12 +461,12 @@
static struct file_operations mtd_fops = {
.owner = THIS_MODULE,
- .llseek = mtd_lseek, /* lseek */
- .read = mtd_read, /* read */
- .write = mtd_write, /* write */
- .ioctl = mtd_ioctl, /* ioctl */
- .open = mtd_open, /* open */
- .release = mtd_close, /* release */
+ .llseek = mtd_lseek,
+ .read = mtd_read,
+ .write = mtd_write,
+ .ioctl = mtd_ioctl,
+ .open = mtd_open,
+ .release = mtd_close,
};
@@ -507,26 +506,18 @@
static int __init init_mtdchar(void)
{
-#ifdef CONFIG_DEVFS_FS
- if (devfs_register_chrdev(MTD_CHAR_MAJOR, "mtd", &mtd_fops))
+ if (register_chrdev(MTD_CHAR_MAJOR, "mtd", &mtd_fops))
{
printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n",
MTD_CHAR_MAJOR);
return -EAGAIN;
}
+#ifdef CONFIG_DEVFS_FS
devfs_dir_handle = devfs_mk_dir(NULL, "mtd", NULL);
register_mtd_user(¬ifier);
-#else
- if (register_chrdev(MTD_CHAR_MAJOR, "mtd", &mtd_fops))
- {
- printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n",
- MTD_CHAR_MAJOR);
- return -EAGAIN;
- }
#endif
-
return 0;
}
@@ -535,10 +526,8 @@
#ifdef CONFIG_DEVFS_FS
unregister_mtd_user(¬ifier);
devfs_unregister(devfs_dir_handle);
- devfs_unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
-#else
- unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
#endif
+ unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
}
module_init(init_mtdchar);
More information about the linux-mtd-cvs
mailing list