Commit ee0f6a15 authored by Dmitry Eremin-Solenikov's avatar Dmitry Eremin-Solenikov Committed by Artem Bityutskiy

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: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 725b75a4
...@@ -1133,8 +1133,6 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) ...@@ -1133,8 +1133,6 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
{ {
struct pxa3xx_nand_platform_data *pdata; struct pxa3xx_nand_platform_data *pdata;
struct pxa3xx_nand_info *info; struct pxa3xx_nand_info *info;
struct mtd_partition *parts;
int nr_parts;
pdata = pdev->dev.platform_data; pdata = pdev->dev.platform_data;
if (!pdata) { if (!pdata) {
...@@ -1152,13 +1150,8 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) ...@@ -1152,13 +1150,8 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
return mtd_device_parse_register(info->mtd, NULL, 0,
nr_parts = parse_mtd_partitions(info->mtd, NULL, &parts, 0); pdata->parts, pdata->nr_parts);
if (nr_parts)
return mtd_device_register(info->mtd, parts, nr_parts);
return mtd_device_register(info->mtd, pdata->parts, pdata->nr_parts);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment