kernel/3.1[02]: move MTD root device setup code to mtdcore
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-3.10 / 509-yaffs-3.4-add-underscore-to-mtd-internal-names.patch
1 --- a/fs/yaffs2/yaffs_vfs_glue.c
2 +++ b/fs/yaffs2/yaffs_vfs_glue.c
3 @@ -2793,6 +2793,15 @@ static struct super_block *yaffs_interna
4 return NULL;
5 }
6
7 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)
8 + T(YAFFS_TRACE_OS, (TSTR(" erase %p\n"), mtd->_erase));
9 + T(YAFFS_TRACE_OS, (TSTR(" read %p\n"), mtd->_read));
10 + T(YAFFS_TRACE_OS, (TSTR(" write %p\n"), mtd->_write));
11 + T(YAFFS_TRACE_OS, (TSTR(" readoob %p\n"), mtd->_read_oob));
12 + T(YAFFS_TRACE_OS, (TSTR(" writeoob %p\n"), mtd->_write_oob));
13 + T(YAFFS_TRACE_OS, (TSTR(" block_isbad %p\n"), mtd->_block_isbad));
14 + T(YAFFS_TRACE_OS, (TSTR(" block_markbad %p\n"), mtd->_block_markbad));
15 +#else
16 T(YAFFS_TRACE_OS, (TSTR(" erase %p\n"), mtd->erase));
17 T(YAFFS_TRACE_OS, (TSTR(" read %p\n"), mtd->read));
18 T(YAFFS_TRACE_OS, (TSTR(" write %p\n"), mtd->write));
19 @@ -2800,6 +2809,7 @@ static struct super_block *yaffs_interna
20 T(YAFFS_TRACE_OS, (TSTR(" writeoob %p\n"), mtd->write_oob));
21 T(YAFFS_TRACE_OS, (TSTR(" block_isbad %p\n"), mtd->block_isbad));
22 T(YAFFS_TRACE_OS, (TSTR(" block_markbad %p\n"), mtd->block_markbad));
23 +#endif
24 T(YAFFS_TRACE_OS, (TSTR(" %s %d\n"), WRITE_SIZE_STR, WRITE_SIZE(mtd)));
25 T(YAFFS_TRACE_OS, (TSTR(" oobsize %d\n"), mtd->oobsize));
26 T(YAFFS_TRACE_OS, (TSTR(" erasesize %d\n"), mtd->erasesize));
27 @@ -2828,6 +2838,15 @@ static struct super_block *yaffs_interna
28
29 if (yaffs_version == 2) {
30 /* Check for version 2 style functions */
31 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
32 + if (!mtd->_erase ||
33 + !mtd->_block_isbad ||
34 + !mtd->_block_markbad ||
35 + !mtd->_read ||
36 + !mtd->_write ||
37 + !mtd->_read_oob ||
38 + !mtd->_write_oob) {
39 +#else
40 if (!mtd->erase ||
41 !mtd->block_isbad ||
42 !mtd->block_markbad ||
43 @@ -2839,6 +2858,7 @@ static struct super_block *yaffs_interna
44 !mtd->write_ecc ||
45 !mtd->read_ecc || !mtd->read_oob || !mtd->write_oob) {
46 #endif
47 +#endif
48 T(YAFFS_TRACE_ALWAYS,
49 (TSTR("yaffs: MTD device does not support required "
50 "functions\n")));
51 @@ -2855,6 +2875,13 @@ static struct super_block *yaffs_interna
52 }
53 } else {
54 /* Check for V1 style functions */
55 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
56 + if (!mtd->_erase ||
57 + !mtd->_read ||
58 + !mtd->_write ||
59 + !mtd->_read_oob ||
60 + !mtd->_write_oob) {
61 +#else
62 if (!mtd->erase ||
63 !mtd->read ||
64 !mtd->write ||
65 @@ -2864,6 +2891,7 @@ static struct super_block *yaffs_interna
66 !mtd->write_ecc ||
67 !mtd->read_ecc || !mtd->read_oob || !mtd->write_oob) {
68 #endif
69 +#endif
70 T(YAFFS_TRACE_ALWAYS,
71 (TSTR("yaffs: MTD device does not support required "
72 "functions\n")));