Commit 29597ca1 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Miquel Raynal

mtd: rawnand: use mtd_device_register() where applicable

If driver doesn't specify parsers it can use that little helper.
Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
Acked-by: default avatarXiaolei Li <xiaolei.li@mediatek.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent c2204734
...@@ -200,8 +200,8 @@ static int __init cmx270_init(void) ...@@ -200,8 +200,8 @@ static int __init cmx270_init(void)
} }
/* Register the partitions */ /* Register the partitions */
ret = mtd_device_parse_register(cmx270_nand_mtd, NULL, NULL, ret = mtd_device_register(cmx270_nand_mtd, partition_info,
partition_info, NUM_PARTITIONS); NUM_PARTITIONS);
if (ret) if (ret)
goto err_scan; goto err_scan;
......
...@@ -310,8 +310,7 @@ static int __init cs553x_init(void) ...@@ -310,8 +310,7 @@ static int __init cs553x_init(void)
for (i = 0; i < NR_CS553X_CONTROLLERS; i++) { for (i = 0; i < NR_CS553X_CONTROLLERS; i++) {
if (cs553x_mtd[i]) { if (cs553x_mtd[i]) {
/* If any devices registered, return success. Else the last error. */ /* If any devices registered, return success. Else the last error. */
mtd_device_parse_register(cs553x_mtd[i], NULL, NULL, mtd_device_register(cs553x_mtd[i], NULL, 0);
NULL, 0);
err = 0; err = 0;
} }
} }
......
...@@ -800,8 +800,7 @@ static int nand_davinci_probe(struct platform_device *pdev) ...@@ -800,8 +800,7 @@ static int nand_davinci_probe(struct platform_device *pdev)
goto err; goto err;
if (pdata->parts) if (pdata->parts)
ret = mtd_device_parse_register(mtd, NULL, NULL, ret = mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
pdata->parts, pdata->nr_parts);
else else
ret = mtd_device_register(mtd, NULL, 0); ret = mtd_device_register(mtd, NULL, 0);
if (ret < 0) if (ret < 0)
......
...@@ -466,9 +466,8 @@ static int jz_nand_probe(struct platform_device *pdev) ...@@ -466,9 +466,8 @@ static int jz_nand_probe(struct platform_device *pdev)
goto err_unclaim_banks; goto err_unclaim_banks;
} }
ret = mtd_device_parse_register(mtd, NULL, NULL, ret = mtd_device_register(mtd, pdata ? pdata->partitions : NULL,
pdata ? pdata->partitions : NULL, pdata ? pdata->num_partitions : 0);
pdata ? pdata->num_partitions : 0);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Failed to add mtd device\n"); dev_err(&pdev->dev, "Failed to add mtd device\n");
......
...@@ -1357,7 +1357,7 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc, ...@@ -1357,7 +1357,7 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc,
if (ret) if (ret)
return ret; return ret;
ret = mtd_device_parse_register(mtd, NULL, NULL, NULL, 0); ret = mtd_device_register(mtd, NULL, 0);
if (ret) { if (ret) {
dev_err(dev, "mtd parse partition error\n"); dev_err(dev, "mtd parse partition error\n");
nand_release(mtd); nand_release(mtd);
......
...@@ -802,8 +802,8 @@ static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info, ...@@ -802,8 +802,8 @@ static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info,
mtdinfo->name = set->name; mtdinfo->name = set->name;
return mtd_device_parse_register(mtdinfo, NULL, NULL, return mtd_device_register(mtdinfo, set->partitions,
set->partitions, set->nr_partitions); set->nr_partitions);
} }
return -ENODEV; return -ENODEV;
......
...@@ -366,7 +366,7 @@ static int __init txx9ndfmc_probe(struct platform_device *dev) ...@@ -366,7 +366,7 @@ static int __init txx9ndfmc_probe(struct platform_device *dev)
} }
mtd->name = txx9_priv->mtdname; mtd->name = txx9_priv->mtdname;
mtd_device_parse_register(mtd, NULL, NULL, NULL, 0); mtd_device_register(mtd, NULL, 0);
drvdata->mtds[i] = mtd; drvdata->mtds[i] = mtd;
} }
......
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