diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2011-06-02 10:00:59 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:09 -0400 |
commit | ee0f6a15b3f9246ae11e581cb9dae8fb2cc5da5c (patch) | |
tree | 7e2d1bfc3e339e820437b028b889b2e6e6a611b9 | |
parent | 725b75a4acd34e39685483864e824b430e55e2ac (diff) |
mtd: pxa3xx_nand.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/pxa3xx_nand.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 5c3af2f72a62..b7db1b2021f2 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c | |||
@@ -1133,8 +1133,6 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) | |||
1133 | { | 1133 | { |
1134 | struct pxa3xx_nand_platform_data *pdata; | 1134 | struct pxa3xx_nand_platform_data *pdata; |
1135 | struct pxa3xx_nand_info *info; | 1135 | struct pxa3xx_nand_info *info; |
1136 | struct mtd_partition *parts; | ||
1137 | int nr_parts; | ||
1138 | 1136 | ||
1139 | pdata = pdev->dev.platform_data; | 1137 | pdata = pdev->dev.platform_data; |
1140 | if (!pdata) { | 1138 | if (!pdata) { |
@@ -1152,13 +1150,8 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) | |||
1152 | return -ENODEV; | 1150 | return -ENODEV; |
1153 | } | 1151 | } |
1154 | 1152 | ||
1155 | 1153 | return mtd_device_parse_register(info->mtd, NULL, 0, | |
1156 | nr_parts = parse_mtd_partitions(info->mtd, NULL, &parts, 0); | 1154 | pdata->parts, pdata->nr_parts); |
1157 | |||
1158 | if (nr_parts) | ||
1159 | return mtd_device_register(info->mtd, parts, nr_parts); | ||
1160 | |||
1161 | return mtd_device_register(info->mtd, pdata->parts, pdata->nr_parts); | ||
1162 | } | 1155 | } |
1163 | 1156 | ||
1164 | #ifdef CONFIG_PM | 1157 | #ifdef CONFIG_PM |