diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/maps/Kconfig | 1 | ||||
-rw-r--r-- | drivers/mtd/maps/Makefile | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/gpio-addr-flash.c | 5 | ||||
-rw-r--r-- | drivers/mtd/maps/sa1100-flash.c | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 6 | ||||
-rw-r--r-- | drivers/mtd/ubi/build.c | 3 | ||||
-rw-r--r-- | drivers/mtd/ubi/scan.c | 7 | ||||
-rw-r--r-- | drivers/mtd/ubi/scan.h | 2 |
8 files changed, 18 insertions, 12 deletions
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 841e085ab74a..14be0755d7cd 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig | |||
@@ -486,6 +486,7 @@ config MTD_BFIN_ASYNC | |||
486 | 486 | ||
487 | config MTD_GPIO_ADDR | 487 | config MTD_GPIO_ADDR |
488 | tristate "GPIO-assisted Flash Chip Support" | 488 | tristate "GPIO-assisted Flash Chip Support" |
489 | depends on GENERIC_GPIO || GPIOLIB | ||
489 | depends on MTD_COMPLEX_MAPPINGS | 490 | depends on MTD_COMPLEX_MAPPINGS |
490 | select MTD_PARTITIONS | 491 | select MTD_PARTITIONS |
491 | help | 492 | help |
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile index 1d5cf8636723..ae2f6dbe43c3 100644 --- a/drivers/mtd/maps/Makefile +++ b/drivers/mtd/maps/Makefile | |||
@@ -58,4 +58,6 @@ obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o | |||
58 | obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o | 58 | obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o |
59 | obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o | 59 | obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o |
60 | obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o | 60 | obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o |
61 | obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-flash.o | ||
62 | obj-$(CONFIG_MTD_VMU) += vmu-flash.o | ||
61 | obj-$(CONFIG_MTD_GPIO_ADDR) += gpio-addr-flash.o | 63 | obj-$(CONFIG_MTD_GPIO_ADDR) += gpio-addr-flash.o |
diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c index 44ef9a49a860..1ad5caf9fe69 100644 --- a/drivers/mtd/maps/gpio-addr-flash.c +++ b/drivers/mtd/maps/gpio-addr-flash.c | |||
@@ -13,7 +13,9 @@ | |||
13 | * Licensed under the GPL-2 or later. | 13 | * Licensed under the GPL-2 or later. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/gpio.h> | ||
16 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/io.h> | ||
17 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
18 | #include <linux/module.h> | 20 | #include <linux/module.h> |
19 | #include <linux/mtd/mtd.h> | 21 | #include <linux/mtd/mtd.h> |
@@ -23,9 +25,6 @@ | |||
23 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
24 | #include <linux/types.h> | 26 | #include <linux/types.h> |
25 | 27 | ||
26 | #include <asm/gpio.h> | ||
27 | #include <asm/io.h> | ||
28 | |||
29 | #define pr_devinit(fmt, args...) ({ static const __devinitconst char __fmt[] = fmt; printk(__fmt, ## args); }) | 28 | #define pr_devinit(fmt, args...) ({ static const __devinitconst char __fmt[] = fmt; printk(__fmt, ## args); }) |
30 | 29 | ||
31 | #define DRIVER_NAME "gpio-addr-flash" | 30 | #define DRIVER_NAME "gpio-addr-flash" |
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c index fdb97f3d30e9..d7a47574d21e 100644 --- a/drivers/mtd/maps/sa1100-flash.c +++ b/drivers/mtd/maps/sa1100-flash.c | |||
@@ -209,8 +209,8 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev, struct resource *r | |||
209 | } | 209 | } |
210 | subdev->mtd->owner = THIS_MODULE; | 210 | subdev->mtd->owner = THIS_MODULE; |
211 | 211 | ||
212 | printk(KERN_INFO "SA1100 flash: CFI device at 0x%08lx, %dMiB, " | 212 | printk(KERN_INFO "SA1100 flash: CFI device at 0x%08lx, %uMiB, %d-bit\n", |
213 | "%d-bit\n", phys, subdev->mtd->size >> 20, | 213 | phys, (unsigned)(subdev->mtd->size >> 20), |
214 | subdev->map.bankwidth * 8); | 214 | subdev->map.bankwidth * 8); |
215 | 215 | ||
216 | return 0; | 216 | return 0; |
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 22113865438b..2957cc70da3d 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -761,6 +761,7 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip) | |||
761 | * @mtd: mtd info structure | 761 | * @mtd: mtd info structure |
762 | * @chip: nand chip info structure | 762 | * @chip: nand chip info structure |
763 | * @buf: buffer to store read data | 763 | * @buf: buffer to store read data |
764 | * @page: page number to read | ||
764 | * | 765 | * |
765 | * Not for syndrome calculating ecc controllers, which use a special oob layout | 766 | * Not for syndrome calculating ecc controllers, which use a special oob layout |
766 | */ | 767 | */ |
@@ -777,6 +778,7 @@ static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, | |||
777 | * @mtd: mtd info structure | 778 | * @mtd: mtd info structure |
778 | * @chip: nand chip info structure | 779 | * @chip: nand chip info structure |
779 | * @buf: buffer to store read data | 780 | * @buf: buffer to store read data |
781 | * @page: page number to read | ||
780 | * | 782 | * |
781 | * We need a special oob layout and handling even when OOB isn't used. | 783 | * We need a special oob layout and handling even when OOB isn't used. |
782 | */ | 784 | */ |
@@ -818,6 +820,7 @@ static int nand_read_page_raw_syndrome(struct mtd_info *mtd, struct nand_chip *c | |||
818 | * @mtd: mtd info structure | 820 | * @mtd: mtd info structure |
819 | * @chip: nand chip info structure | 821 | * @chip: nand chip info structure |
820 | * @buf: buffer to store read data | 822 | * @buf: buffer to store read data |
823 | * @page: page number to read | ||
821 | */ | 824 | */ |
822 | static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip, | 825 | static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip, |
823 | uint8_t *buf, int page) | 826 | uint8_t *buf, int page) |
@@ -939,6 +942,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, uint3 | |||
939 | * @mtd: mtd info structure | 942 | * @mtd: mtd info structure |
940 | * @chip: nand chip info structure | 943 | * @chip: nand chip info structure |
941 | * @buf: buffer to store read data | 944 | * @buf: buffer to store read data |
945 | * @page: page number to read | ||
942 | * | 946 | * |
943 | * Not for syndrome calculating ecc controllers which need a special oob layout | 947 | * Not for syndrome calculating ecc controllers which need a special oob layout |
944 | */ | 948 | */ |
@@ -983,6 +987,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, | |||
983 | * @mtd: mtd info structure | 987 | * @mtd: mtd info structure |
984 | * @chip: nand chip info structure | 988 | * @chip: nand chip info structure |
985 | * @buf: buffer to store read data | 989 | * @buf: buffer to store read data |
990 | * @page: page number to read | ||
986 | * | 991 | * |
987 | * Hardware ECC for large page chips, require OOB to be read first. | 992 | * Hardware ECC for large page chips, require OOB to be read first. |
988 | * For this ECC mode, the write_page method is re-used from ECC_HW. | 993 | * For this ECC mode, the write_page method is re-used from ECC_HW. |
@@ -1031,6 +1036,7 @@ static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd, | |||
1031 | * @mtd: mtd info structure | 1036 | * @mtd: mtd info structure |
1032 | * @chip: nand chip info structure | 1037 | * @chip: nand chip info structure |
1033 | * @buf: buffer to store read data | 1038 | * @buf: buffer to store read data |
1039 | * @page: page number to read | ||
1034 | * | 1040 | * |
1035 | * The hw generator calculates the error syndrome automatically. Therefor | 1041 | * The hw generator calculates the error syndrome automatically. Therefor |
1036 | * we need a special oob layout and handling. | 1042 | * we need a special oob layout and handling. |
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index e1f7d0a78b9d..14cec04c34f9 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/log2.h> | 42 | #include <linux/log2.h> |
43 | #include <linux/kthread.h> | 43 | #include <linux/kthread.h> |
44 | #include <linux/reboot.h> | 44 | #include <linux/reboot.h> |
45 | #include <linux/kernel.h> | ||
45 | #include "ubi.h" | 46 | #include "ubi.h" |
46 | 47 | ||
47 | /* Maximum length of the 'mtd=' parameter */ | 48 | /* Maximum length of the 'mtd=' parameter */ |
@@ -1257,7 +1258,7 @@ static int __init bytes_str_to_int(const char *str) | |||
1257 | unsigned long result; | 1258 | unsigned long result; |
1258 | 1259 | ||
1259 | result = simple_strtoul(str, &endp, 0); | 1260 | result = simple_strtoul(str, &endp, 0); |
1260 | if (str == endp || result < 0) { | 1261 | if (str == endp || result >= INT_MAX) { |
1261 | printk(KERN_ERR "UBI error: incorrect bytes count: \"%s\"\n", | 1262 | printk(KERN_ERR "UBI error: incorrect bytes count: \"%s\"\n", |
1262 | str); | 1263 | str); |
1263 | return -EINVAL; | 1264 | return -EINVAL; |
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index e7161adc419d..90af61a2c3e4 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
@@ -794,16 +794,15 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
794 | * number. | 794 | * number. |
795 | */ | 795 | */ |
796 | image_seq = be32_to_cpu(ech->image_seq); | 796 | image_seq = be32_to_cpu(ech->image_seq); |
797 | if (!si->image_seq_set) { | 797 | if (!ubi->image_seq && image_seq) |
798 | ubi->image_seq = image_seq; | 798 | ubi->image_seq = image_seq; |
799 | si->image_seq_set = 1; | 799 | if (ubi->image_seq && image_seq && |
800 | } else if (ubi->image_seq && ubi->image_seq != image_seq) { | 800 | ubi->image_seq != image_seq) { |
801 | ubi_err("bad image sequence number %d in PEB %d, " | 801 | ubi_err("bad image sequence number %d in PEB %d, " |
802 | "expected %d", image_seq, pnum, ubi->image_seq); | 802 | "expected %d", image_seq, pnum, ubi->image_seq); |
803 | ubi_dbg_dump_ec_hdr(ech); | 803 | ubi_dbg_dump_ec_hdr(ech); |
804 | return -EINVAL; | 804 | return -EINVAL; |
805 | } | 805 | } |
806 | |||
807 | } | 806 | } |
808 | 807 | ||
809 | /* OK, we've done with the EC header, let's look at the VID header */ | 808 | /* OK, we've done with the EC header, let's look at the VID header */ |
diff --git a/drivers/mtd/ubi/scan.h b/drivers/mtd/ubi/scan.h index bab31695dace..ff179ad7ca55 100644 --- a/drivers/mtd/ubi/scan.h +++ b/drivers/mtd/ubi/scan.h | |||
@@ -103,7 +103,6 @@ struct ubi_scan_volume { | |||
103 | * @ec_sum: a temporary variable used when calculating @mean_ec | 103 | * @ec_sum: a temporary variable used when calculating @mean_ec |
104 | * @ec_count: a temporary variable used when calculating @mean_ec | 104 | * @ec_count: a temporary variable used when calculating @mean_ec |
105 | * @corr_count: count of corrupted PEBs | 105 | * @corr_count: count of corrupted PEBs |
106 | * @image_seq_set: indicates @ubi->image_seq is known | ||
107 | * | 106 | * |
108 | * This data structure contains the result of scanning and may be used by other | 107 | * This data structure contains the result of scanning and may be used by other |
109 | * UBI sub-systems to build final UBI data structures, further error-recovery | 108 | * UBI sub-systems to build final UBI data structures, further error-recovery |
@@ -127,7 +126,6 @@ struct ubi_scan_info { | |||
127 | uint64_t ec_sum; | 126 | uint64_t ec_sum; |
128 | int ec_count; | 127 | int ec_count; |
129 | int corr_count; | 128 | int corr_count; |
130 | int image_seq_set; | ||
131 | }; | 129 | }; |
132 | 130 | ||
133 | struct ubi_device; | 131 | struct ubi_device; |