diff options
Diffstat (limited to 'drivers/mtd')
31 files changed, 128 insertions, 75 deletions
diff --git a/drivers/mtd/chips/jedec.c b/drivers/mtd/chips/jedec.c index 62d235a9a4e2..4f6778f3ee3e 100644 --- a/drivers/mtd/chips/jedec.c +++ b/drivers/mtd/chips/jedec.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
20 | #include <linux/slab.h> | ||
20 | #include <linux/mtd/jedec.h> | 21 | #include <linux/mtd/jedec.h> |
21 | #include <linux/mtd/map.h> | 22 | #include <linux/mtd/map.h> |
22 | #include <linux/mtd/mtd.h> | 23 | #include <linux/mtd/mtd.h> |
diff --git a/drivers/mtd/devices/docecc.c b/drivers/mtd/devices/docecc.c index 9a087c1fb0b7..24f670b5a4f3 100644 --- a/drivers/mtd/devices/docecc.c +++ b/drivers/mtd/devices/docecc.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <linux/mtd/mtd.h> | 40 | #include <linux/mtd/mtd.h> |
41 | #include <linux/mtd/doc2000.h> | 41 | #include <linux/mtd/doc2000.h> |
42 | 42 | ||
43 | #define DEBUG 0 | 43 | #define DEBUG_ECC 0 |
44 | /* need to undef it (from asm/termbits.h) */ | 44 | /* need to undef it (from asm/termbits.h) */ |
45 | #undef B0 | 45 | #undef B0 |
46 | 46 | ||
@@ -249,7 +249,7 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], | |||
249 | lambda[j] ^= Alpha_to[modnn(u + tmp)]; | 249 | lambda[j] ^= Alpha_to[modnn(u + tmp)]; |
250 | } | 250 | } |
251 | } | 251 | } |
252 | #if DEBUG >= 1 | 252 | #if DEBUG_ECC >= 1 |
253 | /* Test code that verifies the erasure locator polynomial just constructed | 253 | /* Test code that verifies the erasure locator polynomial just constructed |
254 | Needed only for decoder debugging. */ | 254 | Needed only for decoder debugging. */ |
255 | 255 | ||
@@ -276,7 +276,7 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], | |||
276 | count = -1; | 276 | count = -1; |
277 | goto finish; | 277 | goto finish; |
278 | } | 278 | } |
279 | #if DEBUG >= 2 | 279 | #if DEBUG_ECC >= 2 |
280 | printf("\n Erasure positions as determined by roots of Eras Loc Poly:\n"); | 280 | printf("\n Erasure positions as determined by roots of Eras Loc Poly:\n"); |
281 | for (i = 0; i < count; i++) | 281 | for (i = 0; i < count; i++) |
282 | printf("%d ", loc[i]); | 282 | printf("%d ", loc[i]); |
@@ -409,7 +409,7 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], | |||
409 | den ^= Alpha_to[modnn(lambda[i+1] + i * root[j])]; | 409 | den ^= Alpha_to[modnn(lambda[i+1] + i * root[j])]; |
410 | } | 410 | } |
411 | if (den == 0) { | 411 | if (den == 0) { |
412 | #if DEBUG >= 1 | 412 | #if DEBUG_ECC >= 1 |
413 | printf("\n ERROR: denominator = 0\n"); | 413 | printf("\n ERROR: denominator = 0\n"); |
414 | #endif | 414 | #endif |
415 | /* Convert to dual- basis */ | 415 | /* Convert to dual- basis */ |
diff --git a/drivers/mtd/devices/lart.c b/drivers/mtd/devices/lart.c index dfd335e4a2a8..df987a53ed9c 100644 --- a/drivers/mtd/devices/lart.c +++ b/drivers/mtd/devices/lart.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/types.h> | 44 | #include <linux/types.h> |
45 | #include <linux/init.h> | 45 | #include <linux/init.h> |
46 | #include <linux/errno.h> | 46 | #include <linux/errno.h> |
47 | #include <linux/string.h> | ||
47 | #include <linux/mtd/mtd.h> | 48 | #include <linux/mtd/mtd.h> |
48 | #ifdef HAVE_PARTITIONS | 49 | #ifdef HAVE_PARTITIONS |
49 | #include <linux/mtd/partitions.h> | 50 | #include <linux/mtd/partitions.h> |
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c index bb713fed2f37..1443117fd8f4 100644 --- a/drivers/mtd/devices/mtdram.c +++ b/drivers/mtd/devices/mtdram.c | |||
@@ -91,8 +91,7 @@ static void __exit cleanup_mtdram(void) | |||
91 | { | 91 | { |
92 | if (mtd_info) { | 92 | if (mtd_info) { |
93 | del_mtd_device(mtd_info); | 93 | del_mtd_device(mtd_info); |
94 | if (mtd_info->priv) | 94 | vfree(mtd_info->priv); |
95 | vfree(mtd_info->priv); | ||
96 | kfree(mtd_info); | 95 | kfree(mtd_info); |
97 | } | 96 | } |
98 | } | 97 | } |
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c index a423a382095a..765c0179c8df 100644 --- a/drivers/mtd/devices/phram.c +++ b/drivers/mtd/devices/phram.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/list.h> | 22 | #include <linux/list.h> |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/moduleparam.h> | 24 | #include <linux/moduleparam.h> |
25 | #include <linux/slab.h> | ||
25 | #include <linux/mtd/mtd.h> | 26 | #include <linux/mtd/mtd.h> |
26 | 27 | ||
27 | #define ERROR(fmt, args...) printk(KERN_ERR "phram: " fmt , ## args) | 28 | #define ERROR(fmt, args...) printk(KERN_ERR "phram: " fmt , ## args) |
diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c index d9ab60b36fd4..d32c1b3a8ce3 100644 --- a/drivers/mtd/ftl.c +++ b/drivers/mtd/ftl.c | |||
@@ -1017,27 +1017,16 @@ static int ftl_writesect(struct mtd_blktrans_dev *dev, | |||
1017 | 1017 | ||
1018 | void ftl_freepart(partition_t *part) | 1018 | void ftl_freepart(partition_t *part) |
1019 | { | 1019 | { |
1020 | if (part->VirtualBlockMap) { | ||
1021 | vfree(part->VirtualBlockMap); | 1020 | vfree(part->VirtualBlockMap); |
1022 | part->VirtualBlockMap = NULL; | 1021 | part->VirtualBlockMap = NULL; |
1023 | } | ||
1024 | if (part->VirtualPageMap) { | ||
1025 | kfree(part->VirtualPageMap); | 1022 | kfree(part->VirtualPageMap); |
1026 | part->VirtualPageMap = NULL; | 1023 | part->VirtualPageMap = NULL; |
1027 | } | ||
1028 | if (part->EUNInfo) { | ||
1029 | kfree(part->EUNInfo); | 1024 | kfree(part->EUNInfo); |
1030 | part->EUNInfo = NULL; | 1025 | part->EUNInfo = NULL; |
1031 | } | ||
1032 | if (part->XferInfo) { | ||
1033 | kfree(part->XferInfo); | 1026 | kfree(part->XferInfo); |
1034 | part->XferInfo = NULL; | 1027 | part->XferInfo = NULL; |
1035 | } | ||
1036 | if (part->bam_cache) { | ||
1037 | kfree(part->bam_cache); | 1028 | kfree(part->bam_cache); |
1038 | part->bam_cache = NULL; | 1029 | part->bam_cache = NULL; |
1039 | } | ||
1040 | |||
1041 | } /* ftl_freepart */ | 1030 | } /* ftl_freepart */ |
1042 | 1031 | ||
1043 | static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | 1032 | static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) |
diff --git a/drivers/mtd/maps/bast-flash.c b/drivers/mtd/maps/bast-flash.c index 0c45464e3f7b..bfe994e59265 100644 --- a/drivers/mtd/maps/bast-flash.c +++ b/drivers/mtd/maps/bast-flash.c | |||
@@ -33,13 +33,13 @@ | |||
33 | #include <linux/string.h> | 33 | #include <linux/string.h> |
34 | #include <linux/ioport.h> | 34 | #include <linux/ioport.h> |
35 | #include <linux/device.h> | 35 | #include <linux/device.h> |
36 | 36 | #include <linux/slab.h> | |
37 | #include <linux/platform_device.h> | ||
37 | #include <linux/mtd/mtd.h> | 38 | #include <linux/mtd/mtd.h> |
38 | #include <linux/mtd/map.h> | 39 | #include <linux/mtd/map.h> |
39 | #include <linux/mtd/partitions.h> | 40 | #include <linux/mtd/partitions.h> |
40 | 41 | ||
41 | #include <asm/io.h> | 42 | #include <asm/io.h> |
42 | #include <asm/mach-types.h> | ||
43 | #include <asm/mach/flash.h> | 43 | #include <asm/mach/flash.h> |
44 | 44 | ||
45 | #include <asm/arch/map.h> | 45 | #include <asm/arch/map.h> |
diff --git a/drivers/mtd/maps/ceiva.c b/drivers/mtd/maps/ceiva.c index da8584a662f4..c68b31dc7e6d 100644 --- a/drivers/mtd/maps/ceiva.c +++ b/drivers/mtd/maps/ceiva.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/ioport.h> | 20 | #include <linux/ioport.h> |
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/slab.h> | ||
23 | 24 | ||
24 | #include <linux/mtd/mtd.h> | 25 | #include <linux/mtd/mtd.h> |
25 | #include <linux/mtd/map.h> | 26 | #include <linux/mtd/map.h> |
diff --git a/drivers/mtd/maps/dc21285.c b/drivers/mtd/maps/dc21285.c index 938c41f2f056..e5b74169fde6 100644 --- a/drivers/mtd/maps/dc21285.c +++ b/drivers/mtd/maps/dc21285.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/slab.h> | ||
16 | 17 | ||
17 | #include <linux/mtd/mtd.h> | 18 | #include <linux/mtd/mtd.h> |
18 | #include <linux/mtd/map.h> | 19 | #include <linux/mtd/map.h> |
diff --git a/drivers/mtd/maps/dilnetpc.c b/drivers/mtd/maps/dilnetpc.c index 0bc79c93a584..f99519692cb7 100644 --- a/drivers/mtd/maps/dilnetpc.c +++ b/drivers/mtd/maps/dilnetpc.c | |||
@@ -30,12 +30,15 @@ | |||
30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
31 | #include <linux/kernel.h> | 31 | #include <linux/kernel.h> |
32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
33 | #include <asm/io.h> | 33 | #include <linux/string.h> |
34 | |||
34 | #include <linux/mtd/mtd.h> | 35 | #include <linux/mtd/mtd.h> |
35 | #include <linux/mtd/map.h> | 36 | #include <linux/mtd/map.h> |
36 | #include <linux/mtd/partitions.h> | 37 | #include <linux/mtd/partitions.h> |
37 | #include <linux/mtd/concat.h> | 38 | #include <linux/mtd/concat.h> |
38 | 39 | ||
40 | #include <asm/io.h> | ||
41 | |||
39 | /* | 42 | /* |
40 | ** The DIL/NetPC keeps its BIOS in two distinct flash blocks. | 43 | ** The DIL/NetPC keeps its BIOS in two distinct flash blocks. |
41 | ** Destroying any of these blocks transforms the DNPC into | 44 | ** Destroying any of these blocks transforms the DNPC into |
diff --git a/drivers/mtd/maps/epxa10db-flash.c b/drivers/mtd/maps/epxa10db-flash.c index ab6dbe2b8cce..1df6188926b3 100644 --- a/drivers/mtd/maps/epxa10db-flash.c +++ b/drivers/mtd/maps/epxa10db-flash.c | |||
@@ -27,12 +27,15 @@ | |||
27 | #include <linux/types.h> | 27 | #include <linux/types.h> |
28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
30 | #include <asm/io.h> | 30 | #include <linux/slab.h> |
31 | |||
31 | #include <linux/mtd/mtd.h> | 32 | #include <linux/mtd/mtd.h> |
32 | #include <linux/mtd/map.h> | 33 | #include <linux/mtd/map.h> |
33 | #include <linux/mtd/partitions.h> | 34 | #include <linux/mtd/partitions.h> |
34 | 35 | ||
36 | #include <asm/io.h> | ||
35 | #include <asm/hardware.h> | 37 | #include <asm/hardware.h> |
38 | |||
36 | #ifdef CONFIG_EPXA10DB | 39 | #ifdef CONFIG_EPXA10DB |
37 | #define BOARD_NAME "EPXA10DB" | 40 | #define BOARD_NAME "EPXA10DB" |
38 | #else | 41 | #else |
diff --git a/drivers/mtd/maps/fortunet.c b/drivers/mtd/maps/fortunet.c index 068bb6a54520..00f7bbe5479e 100644 --- a/drivers/mtd/maps/fortunet.c +++ b/drivers/mtd/maps/fortunet.c | |||
@@ -7,11 +7,14 @@ | |||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <asm/io.h> | 10 | #include <linux/string.h> |
11 | |||
11 | #include <linux/mtd/mtd.h> | 12 | #include <linux/mtd/mtd.h> |
12 | #include <linux/mtd/map.h> | 13 | #include <linux/mtd/map.h> |
13 | #include <linux/mtd/partitions.h> | 14 | #include <linux/mtd/partitions.h> |
14 | 15 | ||
16 | #include <asm/io.h> | ||
17 | |||
15 | #define MAX_NUM_REGIONS 4 | 18 | #define MAX_NUM_REGIONS 4 |
16 | #define MAX_NUM_PARTITIONS 8 | 19 | #define MAX_NUM_PARTITIONS 8 |
17 | 20 | ||
diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c index e39a98a0171c..d14a0185b8f4 100644 --- a/drivers/mtd/maps/integrator-flash.c +++ b/drivers/mtd/maps/integrator-flash.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
33 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
34 | #include <linux/ioport.h> | 34 | #include <linux/ioport.h> |
35 | #include <linux/device.h> | 35 | #include <linux/platform_device.h> |
36 | #include <linux/init.h> | 36 | #include <linux/init.h> |
37 | 37 | ||
38 | #include <linux/mtd/mtd.h> | 38 | #include <linux/mtd/mtd.h> |
diff --git a/drivers/mtd/maps/ixp2000.c b/drivers/mtd/maps/ixp2000.c index 3e94b616743d..00b9f67580f1 100644 --- a/drivers/mtd/maps/ixp2000.c +++ b/drivers/mtd/maps/ixp2000.c | |||
@@ -22,15 +22,17 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/string.h> | 24 | #include <linux/string.h> |
25 | #include <linux/slab.h> | ||
26 | #include <linux/ioport.h> | ||
27 | #include <linux/device.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | |||
25 | #include <linux/mtd/mtd.h> | 30 | #include <linux/mtd/mtd.h> |
26 | #include <linux/mtd/map.h> | 31 | #include <linux/mtd/map.h> |
27 | #include <linux/mtd/partitions.h> | 32 | #include <linux/mtd/partitions.h> |
28 | #include <linux/ioport.h> | ||
29 | #include <linux/device.h> | ||
30 | 33 | ||
31 | #include <asm/io.h> | 34 | #include <asm/io.h> |
32 | #include <asm/hardware.h> | 35 | #include <asm/hardware.h> |
33 | #include <asm/mach-types.h> | ||
34 | #include <asm/mach/flash.h> | 36 | #include <asm/mach/flash.h> |
35 | 37 | ||
36 | #include <linux/reboot.h> | 38 | #include <linux/reboot.h> |
diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c index 5afe660aa2c4..733a9297a562 100644 --- a/drivers/mtd/maps/ixp4xx.c +++ b/drivers/mtd/maps/ixp4xx.c | |||
@@ -20,13 +20,16 @@ | |||
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/string.h> | 22 | #include <linux/string.h> |
23 | #include <linux/slab.h> | ||
24 | #include <linux/ioport.h> | ||
25 | #include <linux/device.h> | ||
26 | #include <linux/platform_device.h> | ||
27 | |||
23 | #include <linux/mtd/mtd.h> | 28 | #include <linux/mtd/mtd.h> |
24 | #include <linux/mtd/map.h> | 29 | #include <linux/mtd/map.h> |
25 | #include <linux/mtd/partitions.h> | 30 | #include <linux/mtd/partitions.h> |
26 | #include <linux/ioport.h> | 31 | |
27 | #include <linux/device.h> | ||
28 | #include <asm/io.h> | 32 | #include <asm/io.h> |
29 | #include <asm/mach-types.h> | ||
30 | #include <asm/mach/flash.h> | 33 | #include <asm/mach/flash.h> |
31 | 34 | ||
32 | #include <linux/reboot.h> | 35 | #include <linux/reboot.h> |
@@ -254,6 +257,6 @@ module_init(ixp4xx_flash_init); | |||
254 | module_exit(ixp4xx_flash_exit); | 257 | module_exit(ixp4xx_flash_exit); |
255 | 258 | ||
256 | MODULE_LICENSE("GPL"); | 259 | MODULE_LICENSE("GPL"); |
257 | MODULE_DESCRIPTION("MTD map driver for Intel IXP4xx systems") | 260 | MODULE_DESCRIPTION("MTD map driver for Intel IXP4xx systems"); |
258 | MODULE_AUTHOR("Deepak Saxena"); | 261 | MODULE_AUTHOR("Deepak Saxena"); |
259 | 262 | ||
diff --git a/drivers/mtd/maps/lubbock-flash.c b/drivers/mtd/maps/lubbock-flash.c index 1298de475c9a..2337e0c46750 100644 --- a/drivers/mtd/maps/lubbock-flash.c +++ b/drivers/mtd/maps/lubbock-flash.c | |||
@@ -15,10 +15,13 @@ | |||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/slab.h> | ||
19 | |||
18 | #include <linux/dma-mapping.h> | 20 | #include <linux/dma-mapping.h> |
19 | #include <linux/mtd/mtd.h> | 21 | #include <linux/mtd/mtd.h> |
20 | #include <linux/mtd/map.h> | 22 | #include <linux/mtd/map.h> |
21 | #include <linux/mtd/partitions.h> | 23 | #include <linux/mtd/partitions.h> |
24 | |||
22 | #include <asm/io.h> | 25 | #include <asm/io.h> |
23 | #include <asm/hardware.h> | 26 | #include <asm/hardware.h> |
24 | #include <asm/arch/pxa-regs.h> | 27 | #include <asm/arch/pxa-regs.h> |
diff --git a/drivers/mtd/maps/mainstone-flash.c b/drivers/mtd/maps/mainstone-flash.c index 87e93fa60588..da0f8a692628 100644 --- a/drivers/mtd/maps/mainstone-flash.c +++ b/drivers/mtd/maps/mainstone-flash.c | |||
@@ -16,9 +16,12 @@ | |||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/dma-mapping.h> | 18 | #include <linux/dma-mapping.h> |
19 | #include <linux/slab.h> | ||
20 | |||
19 | #include <linux/mtd/mtd.h> | 21 | #include <linux/mtd/mtd.h> |
20 | #include <linux/mtd/map.h> | 22 | #include <linux/mtd/map.h> |
21 | #include <linux/mtd/partitions.h> | 23 | #include <linux/mtd/partitions.h> |
24 | |||
22 | #include <asm/io.h> | 25 | #include <asm/io.h> |
23 | #include <asm/hardware.h> | 26 | #include <asm/hardware.h> |
24 | #include <asm/arch/pxa-regs.h> | 27 | #include <asm/arch/pxa-regs.h> |
diff --git a/drivers/mtd/maps/omap-toto-flash.c b/drivers/mtd/maps/omap-toto-flash.c index 496109071cb1..da36e8dddd17 100644 --- a/drivers/mtd/maps/omap-toto-flash.c +++ b/drivers/mtd/maps/omap-toto-flash.c | |||
@@ -12,9 +12,9 @@ | |||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | |||
16 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
17 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/slab.h> | ||
18 | 18 | ||
19 | #include <linux/mtd/mtd.h> | 19 | #include <linux/mtd/mtd.h> |
20 | #include <linux/mtd/map.h> | 20 | #include <linux/mtd/map.h> |
diff --git a/drivers/mtd/maps/omap_nor.c b/drivers/mtd/maps/omap_nor.c index 8cc71409a328..7f370bb794fe 100644 --- a/drivers/mtd/maps/omap_nor.c +++ b/drivers/mtd/maps/omap_nor.c | |||
@@ -30,19 +30,20 @@ | |||
30 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 30 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | #include <linux/device.h> | 33 | #include <linux/platform_device.h> |
34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
35 | #include <linux/types.h> | 35 | #include <linux/types.h> |
36 | #include <linux/kernel.h> | 36 | #include <linux/kernel.h> |
37 | #include <linux/init.h> | 37 | #include <linux/init.h> |
38 | #include <linux/ioport.h> | 38 | #include <linux/ioport.h> |
39 | #include <linux/slab.h> | ||
40 | |||
39 | #include <linux/mtd/mtd.h> | 41 | #include <linux/mtd/mtd.h> |
40 | #include <linux/mtd/map.h> | 42 | #include <linux/mtd/map.h> |
41 | #include <linux/mtd/partitions.h> | 43 | #include <linux/mtd/partitions.h> |
42 | 44 | ||
43 | #include <asm/io.h> | 45 | #include <asm/io.h> |
44 | #include <asm/hardware.h> | 46 | #include <asm/hardware.h> |
45 | #include <asm/mach-types.h> | ||
46 | #include <asm/mach/flash.h> | 47 | #include <asm/mach/flash.h> |
47 | #include <asm/arch/tc.h> | 48 | #include <asm/arch/tc.h> |
48 | 49 | ||
diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c index 18dbd3af1eaa..d9c64e99ee32 100644 --- a/drivers/mtd/maps/pci.c +++ b/drivers/mtd/maps/pci.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/pci.h> | 18 | #include <linux/pci.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/slab.h> | ||
20 | 21 | ||
21 | #include <linux/mtd/mtd.h> | 22 | #include <linux/mtd/mtd.h> |
22 | #include <linux/mtd/map.h> | 23 | #include <linux/mtd/map.h> |
diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c index 118b04544cad..104576b5be34 100644 --- a/drivers/mtd/maps/plat-ram.c +++ b/drivers/mtd/maps/plat-ram.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <linux/string.h> | 30 | #include <linux/string.h> |
31 | #include <linux/ioport.h> | 31 | #include <linux/ioport.h> |
32 | #include <linux/device.h> | 32 | #include <linux/device.h> |
33 | #include <linux/slab.h> | ||
34 | #include <linux/platform_device.h> | ||
33 | 35 | ||
34 | #include <linux/mtd/mtd.h> | 36 | #include <linux/mtd/mtd.h> |
35 | #include <linux/mtd/map.h> | 37 | #include <linux/mtd/map.h> |
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c index 52385705da09..c8d0da19d897 100644 --- a/drivers/mtd/maps/sa1100-flash.c +++ b/drivers/mtd/maps/sa1100-flash.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
16 | #include <linux/device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | 18 | ||
19 | #include <linux/mtd/mtd.h> | 19 | #include <linux/mtd/mtd.h> |
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/mtd/partitions.h> | 21 | #include <linux/mtd/partitions.h> |
22 | #include <linux/mtd/concat.h> | 22 | #include <linux/mtd/concat.h> |
23 | 23 | ||
24 | #include <asm/mach-types.h> | 24 | #include <asm/hardware.h> |
25 | #include <asm/io.h> | 25 | #include <asm/io.h> |
26 | #include <asm/sizes.h> | 26 | #include <asm/sizes.h> |
27 | #include <asm/mach/flash.h> | 27 | #include <asm/mach/flash.h> |
@@ -130,20 +130,21 @@ struct sa_subdev_info { | |||
130 | char name[16]; | 130 | char name[16]; |
131 | struct map_info map; | 131 | struct map_info map; |
132 | struct mtd_info *mtd; | 132 | struct mtd_info *mtd; |
133 | struct flash_platform_data *data; | 133 | struct flash_platform_data *plat; |
134 | }; | 134 | }; |
135 | 135 | ||
136 | struct sa_info { | 136 | struct sa_info { |
137 | struct mtd_partition *parts; | 137 | struct mtd_partition *parts; |
138 | struct mtd_info *mtd; | 138 | struct mtd_info *mtd; |
139 | int num_subdev; | 139 | int num_subdev; |
140 | unsigned int nr_parts; | ||
140 | struct sa_subdev_info subdev[0]; | 141 | struct sa_subdev_info subdev[0]; |
141 | }; | 142 | }; |
142 | 143 | ||
143 | static void sa1100_set_vpp(struct map_info *map, int on) | 144 | static void sa1100_set_vpp(struct map_info *map, int on) |
144 | { | 145 | { |
145 | struct sa_subdev_info *subdev = container_of(map, struct sa_subdev_info, map); | 146 | struct sa_subdev_info *subdev = container_of(map, struct sa_subdev_info, map); |
146 | subdev->data->set_vpp(on); | 147 | subdev->plat->set_vpp(on); |
147 | } | 148 | } |
148 | 149 | ||
149 | static void sa1100_destroy_subdev(struct sa_subdev_info *subdev) | 150 | static void sa1100_destroy_subdev(struct sa_subdev_info *subdev) |
@@ -187,7 +188,7 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev, struct resource *r | |||
187 | goto out; | 188 | goto out; |
188 | } | 189 | } |
189 | 190 | ||
190 | if (subdev->data->set_vpp) | 191 | if (subdev->plat->set_vpp) |
191 | subdev->map.set_vpp = sa1100_set_vpp; | 192 | subdev->map.set_vpp = sa1100_set_vpp; |
192 | 193 | ||
193 | subdev->map.phys = phys; | 194 | subdev->map.phys = phys; |
@@ -204,7 +205,7 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev, struct resource *r | |||
204 | * Now let's probe for the actual flash. Do it here since | 205 | * Now let's probe for the actual flash. Do it here since |
205 | * specific machine settings might have been set above. | 206 | * specific machine settings might have been set above. |
206 | */ | 207 | */ |
207 | subdev->mtd = do_map_probe(subdev->data->map_name, &subdev->map); | 208 | subdev->mtd = do_map_probe(subdev->plat->map_name, &subdev->map); |
208 | if (subdev->mtd == NULL) { | 209 | if (subdev->mtd == NULL) { |
209 | ret = -ENXIO; | 210 | ret = -ENXIO; |
210 | goto err; | 211 | goto err; |
@@ -223,13 +224,17 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev, struct resource *r | |||
223 | return ret; | 224 | return ret; |
224 | } | 225 | } |
225 | 226 | ||
226 | static void sa1100_destroy(struct sa_info *info) | 227 | static void sa1100_destroy(struct sa_info *info, struct flash_platform_data *plat) |
227 | { | 228 | { |
228 | int i; | 229 | int i; |
229 | 230 | ||
230 | if (info->mtd) { | 231 | if (info->mtd) { |
231 | del_mtd_partitions(info->mtd); | 232 | if (info->nr_parts == 0) |
232 | 233 | del_mtd_device(info->mtd); | |
234 | #ifdef CONFIG_MTD_PARTITIONS | ||
235 | else | ||
236 | del_mtd_partitions(info->mtd); | ||
237 | #endif | ||
233 | #ifdef CONFIG_MTD_CONCAT | 238 | #ifdef CONFIG_MTD_CONCAT |
234 | if (info->mtd != info->subdev[0].mtd) | 239 | if (info->mtd != info->subdev[0].mtd) |
235 | mtd_concat_destroy(info->mtd); | 240 | mtd_concat_destroy(info->mtd); |
@@ -242,10 +247,13 @@ static void sa1100_destroy(struct sa_info *info) | |||
242 | for (i = info->num_subdev - 1; i >= 0; i--) | 247 | for (i = info->num_subdev - 1; i >= 0; i--) |
243 | sa1100_destroy_subdev(&info->subdev[i]); | 248 | sa1100_destroy_subdev(&info->subdev[i]); |
244 | kfree(info); | 249 | kfree(info); |
250 | |||
251 | if (plat->exit) | ||
252 | plat->exit(); | ||
245 | } | 253 | } |
246 | 254 | ||
247 | static struct sa_info *__init | 255 | static struct sa_info *__init |
248 | sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *flash) | 256 | sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *plat) |
249 | { | 257 | { |
250 | struct sa_info *info; | 258 | struct sa_info *info; |
251 | int nr, size, i, ret = 0; | 259 | int nr, size, i, ret = 0; |
@@ -275,6 +283,12 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *flash | |||
275 | 283 | ||
276 | memset(info, 0, size); | 284 | memset(info, 0, size); |
277 | 285 | ||
286 | if (plat->init) { | ||
287 | ret = plat->init(); | ||
288 | if (ret) | ||
289 | goto err; | ||
290 | } | ||
291 | |||
278 | /* | 292 | /* |
279 | * Claim and then map the memory regions. | 293 | * Claim and then map the memory regions. |
280 | */ | 294 | */ |
@@ -287,8 +301,8 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *flash | |||
287 | break; | 301 | break; |
288 | 302 | ||
289 | subdev->map.name = subdev->name; | 303 | subdev->map.name = subdev->name; |
290 | sprintf(subdev->name, "sa1100-%d", i); | 304 | sprintf(subdev->name, "%s-%d", plat->name, i); |
291 | subdev->data = flash; | 305 | subdev->plat = plat; |
292 | 306 | ||
293 | ret = sa1100_probe_subdev(subdev, res); | 307 | ret = sa1100_probe_subdev(subdev, res); |
294 | if (ret) | 308 | if (ret) |
@@ -309,7 +323,7 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *flash | |||
309 | * otherwise fail. Either way, it'll be called "sa1100". | 323 | * otherwise fail. Either way, it'll be called "sa1100". |
310 | */ | 324 | */ |
311 | if (info->num_subdev == 1) { | 325 | if (info->num_subdev == 1) { |
312 | strcpy(info->subdev[0].name, "sa1100"); | 326 | strcpy(info->subdev[0].name, plat->name); |
313 | info->mtd = info->subdev[0].mtd; | 327 | info->mtd = info->subdev[0].mtd; |
314 | ret = 0; | 328 | ret = 0; |
315 | } else if (info->num_subdev > 1) { | 329 | } else if (info->num_subdev > 1) { |
@@ -322,7 +336,7 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *flash | |||
322 | cdev[i] = info->subdev[i].mtd; | 336 | cdev[i] = info->subdev[i].mtd; |
323 | 337 | ||
324 | info->mtd = mtd_concat_create(cdev, info->num_subdev, | 338 | info->mtd = mtd_concat_create(cdev, info->num_subdev, |
325 | "sa1100"); | 339 | plat->name); |
326 | if (info->mtd == NULL) | 340 | if (info->mtd == NULL) |
327 | ret = -ENXIO; | 341 | ret = -ENXIO; |
328 | #else | 342 | #else |
@@ -336,7 +350,7 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *flash | |||
336 | return info; | 350 | return info; |
337 | 351 | ||
338 | err: | 352 | err: |
339 | sa1100_destroy(info); | 353 | sa1100_destroy(info, plat); |
340 | out: | 354 | out: |
341 | return ERR_PTR(ret); | 355 | return ERR_PTR(ret); |
342 | } | 356 | } |
@@ -346,16 +360,16 @@ static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; | |||
346 | static int __init sa1100_mtd_probe(struct device *dev) | 360 | static int __init sa1100_mtd_probe(struct device *dev) |
347 | { | 361 | { |
348 | struct platform_device *pdev = to_platform_device(dev); | 362 | struct platform_device *pdev = to_platform_device(dev); |
349 | struct flash_platform_data *flash = pdev->dev.platform_data; | 363 | struct flash_platform_data *plat = pdev->dev.platform_data; |
350 | struct mtd_partition *parts; | 364 | struct mtd_partition *parts; |
351 | const char *part_type = NULL; | 365 | const char *part_type = NULL; |
352 | struct sa_info *info; | 366 | struct sa_info *info; |
353 | int err, nr_parts = 0; | 367 | int err, nr_parts = 0; |
354 | 368 | ||
355 | if (!flash) | 369 | if (!plat) |
356 | return -ENODEV; | 370 | return -ENODEV; |
357 | 371 | ||
358 | info = sa1100_setup_mtd(pdev, flash); | 372 | info = sa1100_setup_mtd(pdev, plat); |
359 | if (IS_ERR(info)) { | 373 | if (IS_ERR(info)) { |
360 | err = PTR_ERR(info); | 374 | err = PTR_ERR(info); |
361 | goto out; | 375 | goto out; |
@@ -372,8 +386,8 @@ static int __init sa1100_mtd_probe(struct device *dev) | |||
372 | } else | 386 | } else |
373 | #endif | 387 | #endif |
374 | { | 388 | { |
375 | parts = flash->parts; | 389 | parts = plat->parts; |
376 | nr_parts = flash->nr_parts; | 390 | nr_parts = plat->nr_parts; |
377 | part_type = "static"; | 391 | part_type = "static"; |
378 | } | 392 | } |
379 | 393 | ||
@@ -387,6 +401,8 @@ static int __init sa1100_mtd_probe(struct device *dev) | |||
387 | add_mtd_partitions(info->mtd, parts, nr_parts); | 401 | add_mtd_partitions(info->mtd, parts, nr_parts); |
388 | } | 402 | } |
389 | 403 | ||
404 | info->nr_parts = nr_parts; | ||
405 | |||
390 | dev_set_drvdata(dev, info); | 406 | dev_set_drvdata(dev, info); |
391 | err = 0; | 407 | err = 0; |
392 | 408 | ||
@@ -397,33 +413,44 @@ static int __init sa1100_mtd_probe(struct device *dev) | |||
397 | static int __exit sa1100_mtd_remove(struct device *dev) | 413 | static int __exit sa1100_mtd_remove(struct device *dev) |
398 | { | 414 | { |
399 | struct sa_info *info = dev_get_drvdata(dev); | 415 | struct sa_info *info = dev_get_drvdata(dev); |
416 | struct flash_platform_data *plat = dev->platform_data; | ||
417 | |||
400 | dev_set_drvdata(dev, NULL); | 418 | dev_set_drvdata(dev, NULL); |
401 | sa1100_destroy(info); | 419 | sa1100_destroy(info, plat); |
420 | |||
402 | return 0; | 421 | return 0; |
403 | } | 422 | } |
404 | 423 | ||
405 | #ifdef CONFIG_PM | 424 | #ifdef CONFIG_PM |
406 | static int sa1100_mtd_suspend(struct device *dev, pm_message_t state, u32 level) | 425 | static int sa1100_mtd_suspend(struct device *dev, pm_message_t state) |
407 | { | 426 | { |
408 | struct sa_info *info = dev_get_drvdata(dev); | 427 | struct sa_info *info = dev_get_drvdata(dev); |
409 | int ret = 0; | 428 | int ret = 0; |
410 | 429 | ||
411 | if (info && level == SUSPEND_SAVE_STATE) | 430 | if (info) |
412 | ret = info->mtd->suspend(info->mtd); | 431 | ret = info->mtd->suspend(info->mtd); |
413 | 432 | ||
414 | return ret; | 433 | return ret; |
415 | } | 434 | } |
416 | 435 | ||
417 | static int sa1100_mtd_resume(struct device *dev, u32 level) | 436 | static int sa1100_mtd_resume(struct device *dev) |
418 | { | 437 | { |
419 | struct sa_info *info = dev_get_drvdata(dev); | 438 | struct sa_info *info = dev_get_drvdata(dev); |
420 | if (info && level == RESUME_RESTORE_STATE) | 439 | if (info) |
421 | info->mtd->resume(info->mtd); | 440 | info->mtd->resume(info->mtd); |
422 | return 0; | 441 | return 0; |
423 | } | 442 | } |
443 | |||
444 | static void sa1100_mtd_shutdown(struct device *dev) | ||
445 | { | ||
446 | struct sa_info *info = dev_get_drvdata(dev); | ||
447 | if (info && info->mtd->suspend(info->mtd) == 0) | ||
448 | info->mtd->resume(info->mtd); | ||
449 | } | ||
424 | #else | 450 | #else |
425 | #define sa1100_mtd_suspend NULL | 451 | #define sa1100_mtd_suspend NULL |
426 | #define sa1100_mtd_resume NULL | 452 | #define sa1100_mtd_resume NULL |
453 | #define sa1100_mtd_shutdown NULL | ||
427 | #endif | 454 | #endif |
428 | 455 | ||
429 | static struct device_driver sa1100_mtd_driver = { | 456 | static struct device_driver sa1100_mtd_driver = { |
@@ -433,6 +460,7 @@ static struct device_driver sa1100_mtd_driver = { | |||
433 | .remove = __exit_p(sa1100_mtd_remove), | 460 | .remove = __exit_p(sa1100_mtd_remove), |
434 | .suspend = sa1100_mtd_suspend, | 461 | .suspend = sa1100_mtd_suspend, |
435 | .resume = sa1100_mtd_resume, | 462 | .resume = sa1100_mtd_resume, |
463 | .shutdown = sa1100_mtd_shutdown, | ||
436 | }; | 464 | }; |
437 | 465 | ||
438 | static int __init sa1100_mtd_init(void) | 466 | static int __init sa1100_mtd_init(void) |
diff --git a/drivers/mtd/maps/sharpsl-flash.c b/drivers/mtd/maps/sharpsl-flash.c index d15da6fd84c1..b7f093fbf9b0 100644 --- a/drivers/mtd/maps/sharpsl-flash.c +++ b/drivers/mtd/maps/sharpsl-flash.c | |||
@@ -82,7 +82,7 @@ int __init init_sharpsl(void) | |||
82 | } else if (machine_is_tosa()) { | 82 | } else if (machine_is_tosa()) { |
83 | sharpsl_partitions[0].size=0x006a0000; | 83 | sharpsl_partitions[0].size=0x006a0000; |
84 | sharpsl_partitions[0].offset=0x00160000; | 84 | sharpsl_partitions[0].offset=0x00160000; |
85 | } else if (machine_is_spitz()) { | 85 | } else if (machine_is_spitz() || machine_is_akita() || machine_is_borzoi()) { |
86 | sharpsl_partitions[0].size=0x006b0000; | 86 | sharpsl_partitions[0].size=0x006b0000; |
87 | sharpsl_partitions[0].offset=0x00140000; | 87 | sharpsl_partitions[0].offset=0x00140000; |
88 | } else { | 88 | } else { |
diff --git a/drivers/mtd/maps/tqm8xxl.c b/drivers/mtd/maps/tqm8xxl.c index 995e9991cb8d..4e28b977f224 100644 --- a/drivers/mtd/maps/tqm8xxl.c +++ b/drivers/mtd/maps/tqm8xxl.c | |||
@@ -27,12 +27,14 @@ | |||
27 | #include <linux/types.h> | 27 | #include <linux/types.h> |
28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
30 | #include <asm/io.h> | 30 | #include <linux/slab.h> |
31 | 31 | ||
32 | #include <linux/mtd/mtd.h> | 32 | #include <linux/mtd/mtd.h> |
33 | #include <linux/mtd/map.h> | 33 | #include <linux/mtd/map.h> |
34 | #include <linux/mtd/partitions.h> | 34 | #include <linux/mtd/partitions.h> |
35 | 35 | ||
36 | #include <asm/io.h> | ||
37 | |||
36 | #define FLASH_ADDR 0x40000000 | 38 | #define FLASH_ADDR 0x40000000 |
37 | #define FLASH_SIZE 0x00800000 | 39 | #define FLASH_SIZE 0x00800000 |
38 | #define FLASH_BANK_MAX 4 | 40 | #define FLASH_BANK_MAX 4 |
diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c index 811d92e5f5b1..cc372136e852 100644 --- a/drivers/mtd/maps/uclinux.c +++ b/drivers/mtd/maps/uclinux.c | |||
@@ -25,9 +25,6 @@ | |||
25 | 25 | ||
26 | /****************************************************************************/ | 26 | /****************************************************************************/ |
27 | 27 | ||
28 | |||
29 | /****************************************************************************/ | ||
30 | |||
31 | struct map_info uclinux_ram_map = { | 28 | struct map_info uclinux_ram_map = { |
32 | .name = "RAM", | 29 | .name = "RAM", |
33 | }; | 30 | }; |
@@ -60,14 +57,15 @@ int __init uclinux_mtd_init(void) | |||
60 | struct mtd_info *mtd; | 57 | struct mtd_info *mtd; |
61 | struct map_info *mapp; | 58 | struct map_info *mapp; |
62 | extern char _ebss; | 59 | extern char _ebss; |
60 | unsigned long addr = (unsigned long) &_ebss; | ||
63 | 61 | ||
64 | mapp = &uclinux_ram_map; | 62 | mapp = &uclinux_ram_map; |
65 | mapp->phys = (unsigned long) &_ebss; | 63 | mapp->phys = addr; |
66 | mapp->size = PAGE_ALIGN(*((unsigned long *)((&_ebss) + 8))); | 64 | mapp->size = PAGE_ALIGN(ntohl(*((unsigned long *)(addr + 8)))); |
67 | mapp->bankwidth = 4; | 65 | mapp->bankwidth = 4; |
68 | 66 | ||
69 | printk("uclinux[mtd]: RAM probe address=0x%x size=0x%x\n", | 67 | printk("uclinux[mtd]: RAM probe address=0x%x size=0x%x\n", |
70 | (int) mapp->map_priv_2, (int) mapp->size); | 68 | (int) mapp->phys, (int) mapp->size); |
71 | 69 | ||
72 | mapp->virt = ioremap_nocache(mapp->phys, mapp->size); | 70 | mapp->virt = ioremap_nocache(mapp->phys, mapp->size); |
73 | 71 | ||
@@ -95,7 +93,6 @@ int __init uclinux_mtd_init(void) | |||
95 | printk("uclinux[mtd]: set %s to be root filesystem\n", | 93 | printk("uclinux[mtd]: set %s to be root filesystem\n", |
96 | uclinux_romfs[0].name); | 94 | uclinux_romfs[0].name); |
97 | ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, 0); | 95 | ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, 0); |
98 | put_mtd_device(mtd); | ||
99 | 96 | ||
100 | return(0); | 97 | return(0); |
101 | } | 98 | } |
@@ -109,7 +106,7 @@ void __exit uclinux_mtd_cleanup(void) | |||
109 | map_destroy(uclinux_ram_mtdinfo); | 106 | map_destroy(uclinux_ram_mtdinfo); |
110 | uclinux_ram_mtdinfo = NULL; | 107 | uclinux_ram_mtdinfo = NULL; |
111 | } | 108 | } |
112 | if (uclinux_ram_map.map_priv_1) { | 109 | if (uclinux_ram_map.virt) { |
113 | iounmap((void *) uclinux_ram_map.virt); | 110 | iounmap((void *) uclinux_ram_map.virt); |
114 | uclinux_ram_map.virt = 0; | 111 | uclinux_ram_map.virt = 0; |
115 | } | 112 | } |
diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c index b7c32c242bc7..400dd9c89883 100644 --- a/drivers/mtd/mtdblock.c +++ b/drivers/mtd/mtdblock.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
17 | #include <linux/vmalloc.h> | 17 | #include <linux/vmalloc.h> |
18 | #include <linux/sched.h> /* TASK_* */ | ||
18 | #include <linux/mtd/mtd.h> | 19 | #include <linux/mtd/mtd.h> |
19 | #include <linux/mtd/blktrans.h> | 20 | #include <linux/mtd/blktrans.h> |
20 | 21 | ||
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 4b3c6263e7fc..8c0d94b72b63 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
16 | #include <linux/sched.h> /* TASK_* */ | ||
16 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
17 | 18 | ||
18 | #include <linux/device.h> | 19 | #include <linux/device.h> |
@@ -24,10 +25,10 @@ static void mtd_notify_add(struct mtd_info* mtd) | |||
24 | if (!mtd) | 25 | if (!mtd) |
25 | return; | 26 | return; |
26 | 27 | ||
27 | class_device_create(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2), | 28 | class_device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2), |
28 | NULL, "mtd%d", mtd->index); | 29 | NULL, "mtd%d", mtd->index); |
29 | 30 | ||
30 | class_device_create(mtd_class, | 31 | class_device_create(mtd_class, NULL, |
31 | MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1), | 32 | MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1), |
32 | NULL, "mtd%dro", mtd->index); | 33 | NULL, "mtd%dro", mtd->index); |
33 | } | 34 | } |
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c index 8f66d093c80d..f3e65af33a9c 100644 --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
17 | 17 | #include <linux/sched.h> /* TASK_* */ | |
18 | #include <linux/mtd/mtd.h> | 18 | #include <linux/mtd/mtd.h> |
19 | #include <linux/mtd/concat.h> | 19 | #include <linux/mtd/concat.h> |
20 | 20 | ||
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index eee5115658c8..04e54318bc6a 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -526,6 +526,7 @@ static void nand_wait_ready(struct mtd_info *mtd) | |||
526 | do { | 526 | do { |
527 | if (this->dev_ready(mtd)) | 527 | if (this->dev_ready(mtd)) |
528 | return; | 528 | return; |
529 | touch_softlockup_watchdog(); | ||
529 | } while (time_before(jiffies, timeo)); | 530 | } while (time_before(jiffies, timeo)); |
530 | } | 531 | } |
531 | 532 | ||
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 891e3a1b9110..2df5e47d1f5c 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c | |||
@@ -48,9 +48,10 @@ | |||
48 | #include <linux/kernel.h> | 48 | #include <linux/kernel.h> |
49 | #include <linux/string.h> | 49 | #include <linux/string.h> |
50 | #include <linux/ioport.h> | 50 | #include <linux/ioport.h> |
51 | #include <linux/device.h> | 51 | #include <linux/platform_device.h> |
52 | #include <linux/delay.h> | 52 | #include <linux/delay.h> |
53 | #include <linux/err.h> | 53 | #include <linux/err.h> |
54 | #include <linux/slab.h> | ||
54 | 55 | ||
55 | #include <linux/mtd/mtd.h> | 56 | #include <linux/mtd/mtd.h> |
56 | #include <linux/mtd/nand.h> | 57 | #include <linux/mtd/nand.h> |
@@ -58,7 +59,6 @@ | |||
58 | #include <linux/mtd/partitions.h> | 59 | #include <linux/mtd/partitions.h> |
59 | 60 | ||
60 | #include <asm/io.h> | 61 | #include <asm/io.h> |
61 | #include <asm/mach-types.h> | ||
62 | #include <asm/hardware/clock.h> | 62 | #include <asm/hardware/clock.h> |
63 | 63 | ||
64 | #include <asm/arch/regs-nand.h> | 64 | #include <asm/arch/regs-nand.h> |
diff --git a/drivers/mtd/nand/sharpsl.c b/drivers/mtd/nand/sharpsl.c index 9853b87bb756..88b5b5b40b43 100644 --- a/drivers/mtd/nand/sharpsl.c +++ b/drivers/mtd/nand/sharpsl.c | |||
@@ -221,10 +221,16 @@ sharpsl_nand_init(void) | |||
221 | sharpsl_partition_info[1].size=25 * 1024 * 1024; | 221 | sharpsl_partition_info[1].size=25 * 1024 * 1024; |
222 | } else if (machine_is_husky()) { | 222 | } else if (machine_is_husky()) { |
223 | sharpsl_partition_info[1].size=53 * 1024 * 1024; | 223 | sharpsl_partition_info[1].size=53 * 1024 * 1024; |
224 | } | 224 | } else if (machine_is_spitz()) { |
225 | sharpsl_partition_info[1].size=5 * 1024 * 1024; | ||
226 | } else if (machine_is_akita()) { | ||
227 | sharpsl_partition_info[1].size=58 * 1024 * 1024; | ||
228 | } else if (machine_is_borzoi()) { | ||
229 | sharpsl_partition_info[1].size=32 * 1024 * 1024; | ||
230 | } | ||
225 | } | 231 | } |
226 | 232 | ||
227 | if (machine_is_husky()) { | 233 | if (machine_is_husky() || machine_is_borzoi()) { |
228 | /* Need to use small eraseblock size for backward compatibility */ | 234 | /* Need to use small eraseblock size for backward compatibility */ |
229 | sharpsl_mtd->flags |= MTD_NO_VIRTBLOCKS; | 235 | sharpsl_mtd->flags |= MTD_NO_VIRTBLOCKS; |
230 | } | 236 | } |