diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2011-06-02 10:01:03 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:09 -0400 |
commit | 3af55a89912e7e4b2a09d4c8c04fd884a6cf151f (patch) | |
tree | a89ae5df0274b32cf05fc36c18d50d0f24557879 | |
parent | 599501a749a1ca3baa94ac9714f06782f63439b0 (diff) |
mtd: sharpsl.c: use mtd_device_parse_register
Replace custom invocations of parse_mtd_partitions and mtd_device_register
with common mtd_device_parse_register call. This would bring: standard
handling of all errors, fallback to default partitions, etc.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r-- | drivers/mtd/nand/sharpsl.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/mtd/nand/sharpsl.c b/drivers/mtd/nand/sharpsl.c index b3377f88326e..619d2a504788 100644 --- a/drivers/mtd/nand/sharpsl.c +++ b/drivers/mtd/nand/sharpsl.c | |||
@@ -109,8 +109,6 @@ static int sharpsl_nand_calculate_ecc(struct mtd_info *mtd, const u_char * dat, | |||
109 | static int __devinit sharpsl_nand_probe(struct platform_device *pdev) | 109 | static int __devinit sharpsl_nand_probe(struct platform_device *pdev) |
110 | { | 110 | { |
111 | struct nand_chip *this; | 111 | struct nand_chip *this; |
112 | struct mtd_partition *sharpsl_partition_info; | ||
113 | int nr_partitions; | ||
114 | struct resource *r; | 112 | struct resource *r; |
115 | int err = 0; | 113 | int err = 0; |
116 | struct sharpsl_nand *sharpsl; | 114 | struct sharpsl_nand *sharpsl; |
@@ -182,14 +180,9 @@ static int __devinit sharpsl_nand_probe(struct platform_device *pdev) | |||
182 | 180 | ||
183 | /* Register the partitions */ | 181 | /* Register the partitions */ |
184 | sharpsl->mtd.name = "sharpsl-nand"; | 182 | sharpsl->mtd.name = "sharpsl-nand"; |
185 | nr_partitions = parse_mtd_partitions(&sharpsl->mtd, NULL, &sharpsl_partition_info, 0); | ||
186 | if (nr_partitions <= 0) { | ||
187 | nr_partitions = data->nr_partitions; | ||
188 | sharpsl_partition_info = data->partitions; | ||
189 | } | ||
190 | 183 | ||
191 | err = mtd_device_register(&sharpsl->mtd, sharpsl_partition_info, | 184 | err = mtd_device_parse_register(&sharpsl->mtd, NULL, 0, |
192 | nr_partitions); | 185 | data->partitions, data->nr_partitions); |
193 | if (err) | 186 | if (err) |
194 | goto err_add; | 187 | goto err_add; |
195 | 188 | ||