1 diff -ur linux-2.6.15-rc5/drivers/mtd/mtd_blkdevs.c linux-2.6.15-rc5-openwrt/drivers/mtd/mtd_blkdevs.c
2 --- linux-2.6.15-rc5/drivers/mtd/mtd_blkdevs.c 2005-12-04 06:10:42.000000000 +0100
3 +++ linux-2.6.15-rc5-openwrt/drivers/mtd/mtd_blkdevs.c 2005-12-15 07:53:20.000000000 +0100
5 #include <linux/init.h>
6 #include <asm/semaphore.h>
7 #include <asm/uaccess.h>
8 +#ifdef CONFIG_DEVFS_FS
9 +#include <linux/devfs_fs_kernel.h>
12 static LIST_HEAD(blktrans_majors);
15 snprintf(gd->disk_name, sizeof(gd->disk_name),
16 "%s%d", tr->name, new->devnum);
18 +#ifdef CONFIG_DEVFS_FS
19 + snprintf(gd->devfs_name, sizeof(gd->devfs_name),
20 + "%s/%c", tr->name, (tr->part_bits?'a':'0') + new->devnum);
23 /* 2.5 has capacity in units of 512 bytes while still
24 having BLOCK_SIZE_BITS set to 10. Just to keep us amused. */
25 set_capacity(gd, (new->size * new->blksize) >> 9);
30 +#ifdef CONFIG_DEVFS_FS
31 + devfs_mk_dir(tr->name);
34 INIT_LIST_HEAD(&tr->devs);
35 list_add(&tr->list, &blktrans_majors);
41 +#ifdef CONFIG_DEVFS_FS
42 + devfs_remove(tr->name);
45 blk_cleanup_queue(tr->blkcore_priv->rq);
46 unregister_blkdev(tr->major, tr->name);
48 diff -ur linux-2.6.15-rc5/drivers/mtd/mtdchar.c linux-2.6.15-rc5-openwrt/drivers/mtd/mtdchar.c
49 --- linux-2.6.15-rc5/drivers/mtd/mtdchar.c 2005-12-04 06:10:42.000000000 +0100
50 +++ linux-2.6.15-rc5-openwrt/drivers/mtd/mtdchar.c 2005-12-15 07:49:15.000000000 +0100
54 #include <linux/config.h>
55 -#include <linux/device.h>
57 #include <linux/init.h>
58 #include <linux/kernel.h>
61 #include <asm/uaccess.h>
63 +#ifdef CONFIG_DEVFS_FS
64 +#include <linux/devfs_fs_kernel.h>
66 +#include <linux/device.h>
68 static struct class *mtd_class;
71 static void mtd_notify_add(struct mtd_info* mtd)
76 +#ifdef CONFIG_DEVFS_FS
77 + devfs_mk_cdev(MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
78 + S_IFCHR | S_IRUGO | S_IWUGO, "mtd/%d", mtd->index);
80 + devfs_mk_cdev(MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
81 + S_IFCHR | S_IRUGO, "mtd/%dro", mtd->index);
83 class_device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
84 NULL, "mtd%d", mtd->index);
86 class_device_create(mtd_class, NULL,
87 MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
88 NULL, "mtd%dro", mtd->index);
92 static void mtd_notify_remove(struct mtd_info* mtd)
97 +#ifdef CONFIG_DEVFS_FS
98 + devfs_remove("mtd/%d", mtd->index);
99 + devfs_remove("mtd/%dro", mtd->index);
101 class_device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2));
102 class_device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1));
106 static struct mtd_notifier notifier = {
108 .remove = mtd_notify_remove,
111 +#ifdef CONFIG_DEVFS_FS
112 + static inline void mtdchar_devfs_init(void)
114 + devfs_mk_dir("mtd");
115 + register_mtd_user(¬ifier);
117 + static inline void mtdchar_devfs_exit(void)
119 + unregister_mtd_user(¬ifier);
120 + devfs_remove("mtd");
123 + #define mtdchar_devfs_init() do { } while(0)
124 + #define mtdchar_devfs_exit() do { } while(0)
128 * We use file->private_data to store a pointer to the MTDdevice.
129 * Since alighment is at least 32 bits, we have 2 bits free for OTP
134 +#ifdef CONFIG_DEVFS_FS
135 + mtdchar_devfs_init();
137 mtd_class = class_create(THIS_MODULE, "mtd");
139 if (IS_ERR(mtd_class)) {
140 @@ -652,13 +689,19 @@
143 register_mtd_user(¬ifier);
148 static void __exit cleanup_mtdchar(void)
151 +#ifdef CONFIG_DEVFS_FS
152 + mtdchar_devfs_exit();
154 unregister_mtd_user(¬ifier);
155 class_destroy(mtd_class);
157 unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
160 diff -ur linux-2.6.15-rc5/fs/Kconfig linux-2.6.15-rc5-openwrt/fs/Kconfig
161 --- linux-2.6.15-rc5/fs/Kconfig 2005-12-04 06:10:42.000000000 +0100
162 +++ linux-2.6.15-rc5-openwrt/fs/Kconfig 2005-12-15 07:44:01.000000000 +0100
165 Exports the dump image of crashed kernel in ELF format.
168 + bool "/dev file system support (OBSOLETE)"
169 + depends on EXPERIMENTAL
171 + This is support for devfs, a virtual file system (like /proc) which
172 + provides the file system interface to device drivers, normally found
173 + in /dev. Devfs does not depend on major and minor number
174 + allocations. Device drivers register entries in /dev which then
175 + appear automatically, which means that the system administrator does
176 + not have to create character and block special device files in the
177 + /dev directory using the mknod command (or MAKEDEV script) anymore.
179 + This is work in progress. If you want to use this, you *must* read
180 + the material in <file:Documentation/filesystems/devfs/>, especially
181 + the file README there.
183 + Note that devfs no longer manages /dev/pts! If you are using UNIX98
184 + ptys, you will also need to mount the /dev/pts filesystem (devpts).
186 + Note that devfs has been obsoleted by udev,
187 + <http://www.kernel.org/pub/linux/utils/kernel/hotplug/>.
188 + It has been stripped down to a bare minimum and is only provided for
189 + legacy installations that use its naming scheme which is
190 + unfortunately different from the names normal Linux installations
196 + bool "Automatically mount at boot"
197 + depends on DEVFS_FS
199 + This option appears if you have CONFIG_DEVFS_FS enabled. Setting
200 + this to 'Y' will make the kernel automatically mount devfs onto /dev
201 + when the system is booted, before the init thread is started.
202 + You can override this with the "devfs=nomount" boot option.
208 + depends on DEVFS_FS
210 + If you say Y here, then the /dev file system code will generate
211 + debugging messages. See the file
212 + <file:Documentation/filesystems/devfs/boot-options> for more
218 bool "sysfs file system support" if EMBEDDED