diff options
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 | ||