diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-07 12:11:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-07 12:11:16 -0500 |
commit | e0d65113a70f1dc514e625cc4e7a7485a4bf72df (patch) | |
tree | 7320a130dc304623f5cf4b5dd8f67fb1776225ca /drivers/mtd/nand/omap2.c | |
parent | cf5e15fbd72c13977720aa15b7b7e00e1d8fd8f2 (diff) | |
parent | 48e546b7f281f251893baa40769581fd15f085fb (diff) |
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (226 commits)
mtd: tests: annotate as DANGEROUS in Kconfig
mtd: tests: don't use mtd0 as a default
mtd: clean up usage of MTD_DOCPROBE_ADDRESS
jffs2: add compr=lzo and compr=zlib options
jffs2: implement mount option parsing and compression overriding
mtd: nand: initialize ops.mode
mtd: provide an alias for the redboot module name
mtd: m25p80: don't probe device which has status of 'disabled'
mtd: nand_h1900 never worked
mtd: Add DiskOnChip G3 support
mtd: m25p80: add EON flash EN25Q32B into spi flash id table
mtd: mark block device queue as non-rotational
mtd: r852: make r852_pm_ops static
mtd: m25p80: add support for at25df321a spi data flash
mtd: mxc_nand: preset_v1_v2: unlock all NAND flash blocks
mtd: nand: switch `check_pattern()' to standard `memcmp()'
mtd: nand: invalidate cache on unaligned reads
mtd: nand: do not scan bad blocks with NAND_BBT_NO_OOB set
mtd: nand: wait to set BBT version
mtd: nand: scrub BBT on ECC errors
...
Fix up trivial conflicts:
- arch/arm/mach-at91/board-usb-a9260.c
Merged into board-usb-a926x.c
- drivers/mtd/maps/lantiq-flash.c
add_mtd_partitions -> mtd_device_register vs changed to use
mtd_device_parse_register.
Diffstat (limited to 'drivers/mtd/nand/omap2.c')
-rw-r--r-- | drivers/mtd/nand/omap2.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index ec22a5aab038..f745f00f3167 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
@@ -95,8 +95,6 @@ | |||
95 | #define P4e_s(a) (TF(a & NAND_Ecc_P4e) << 0) | 95 | #define P4e_s(a) (TF(a & NAND_Ecc_P4e) << 0) |
96 | #define P4o_s(a) (TF(a & NAND_Ecc_P4o) << 1) | 96 | #define P4o_s(a) (TF(a & NAND_Ecc_P4o) << 1) |
97 | 97 | ||
98 | static const char *part_probes[] = { "cmdlinepart", NULL }; | ||
99 | |||
100 | /* oob info generated runtime depending on ecc algorithm and layout selected */ | 98 | /* oob info generated runtime depending on ecc algorithm and layout selected */ |
101 | static struct nand_ecclayout omap_oobinfo; | 99 | static struct nand_ecclayout omap_oobinfo; |
102 | /* Define some generic bad / good block scan pattern which are used | 100 | /* Define some generic bad / good block scan pattern which are used |
@@ -115,7 +113,6 @@ struct omap_nand_info { | |||
115 | struct nand_hw_control controller; | 113 | struct nand_hw_control controller; |
116 | struct omap_nand_platform_data *pdata; | 114 | struct omap_nand_platform_data *pdata; |
117 | struct mtd_info mtd; | 115 | struct mtd_info mtd; |
118 | struct mtd_partition *parts; | ||
119 | struct nand_chip nand; | 116 | struct nand_chip nand; |
120 | struct platform_device *pdev; | 117 | struct platform_device *pdev; |
121 | 118 | ||
@@ -745,12 +742,12 @@ static int omap_compare_ecc(u8 *ecc_data1, /* read from NAND memory */ | |||
745 | 742 | ||
746 | case 1: | 743 | case 1: |
747 | /* Uncorrectable error */ | 744 | /* Uncorrectable error */ |
748 | DEBUG(MTD_DEBUG_LEVEL0, "ECC UNCORRECTED_ERROR 1\n"); | 745 | pr_debug("ECC UNCORRECTED_ERROR 1\n"); |
749 | return -1; | 746 | return -1; |
750 | 747 | ||
751 | case 11: | 748 | case 11: |
752 | /* UN-Correctable error */ | 749 | /* UN-Correctable error */ |
753 | DEBUG(MTD_DEBUG_LEVEL0, "ECC UNCORRECTED_ERROR B\n"); | 750 | pr_debug("ECC UNCORRECTED_ERROR B\n"); |
754 | return -1; | 751 | return -1; |
755 | 752 | ||
756 | case 12: | 753 | case 12: |
@@ -767,8 +764,8 @@ static int omap_compare_ecc(u8 *ecc_data1, /* read from NAND memory */ | |||
767 | 764 | ||
768 | find_bit = (ecc_bit[5] << 2) + (ecc_bit[3] << 1) + ecc_bit[1]; | 765 | find_bit = (ecc_bit[5] << 2) + (ecc_bit[3] << 1) + ecc_bit[1]; |
769 | 766 | ||
770 | DEBUG(MTD_DEBUG_LEVEL0, "Correcting single bit ECC error at " | 767 | pr_debug("Correcting single bit ECC error at offset: " |
771 | "offset: %d, bit: %d\n", find_byte, find_bit); | 768 | "%d, bit: %d\n", find_byte, find_bit); |
772 | 769 | ||
773 | page_data[find_byte] ^= (1 << find_bit); | 770 | page_data[find_byte] ^= (1 << find_bit); |
774 | 771 | ||
@@ -780,7 +777,7 @@ static int omap_compare_ecc(u8 *ecc_data1, /* read from NAND memory */ | |||
780 | ecc_data2[2] == 0) | 777 | ecc_data2[2] == 0) |
781 | return 0; | 778 | return 0; |
782 | } | 779 | } |
783 | DEBUG(MTD_DEBUG_LEVEL0, "UNCORRECTED_ERROR default\n"); | 780 | pr_debug("UNCORRECTED_ERROR default\n"); |
784 | return -1; | 781 | return -1; |
785 | } | 782 | } |
786 | } | 783 | } |
@@ -1104,13 +1101,8 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
1104 | goto out_release_mem_region; | 1101 | goto out_release_mem_region; |
1105 | } | 1102 | } |
1106 | 1103 | ||
1107 | err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0); | 1104 | mtd_device_parse_register(&info->mtd, NULL, 0, |
1108 | if (err > 0) | 1105 | pdata->parts, pdata->nr_parts); |
1109 | mtd_device_register(&info->mtd, info->parts, err); | ||
1110 | else if (pdata->parts) | ||
1111 | mtd_device_register(&info->mtd, pdata->parts, pdata->nr_parts); | ||
1112 | else | ||
1113 | mtd_device_register(&info->mtd, NULL, 0); | ||
1114 | 1106 | ||
1115 | platform_set_drvdata(pdev, &info->mtd); | 1107 | platform_set_drvdata(pdev, &info->mtd); |
1116 | 1108 | ||