mtd: rawnand: use mtd_device_register() where applicable

If driver doesn't specify parsers it can use that little helper.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Xiaolei Li <xiaolei.li@mediatek.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
Rafał Miłecki 2018-07-13 11:27:31 +02:00 committed by Miquel Raynal
parent c2204734bb
commit 29597ca14d
7 changed files with 10 additions and 13 deletions

View File

@ -200,8 +200,8 @@ static int __init cmx270_init(void)
}
/* Register the partitions */
ret = mtd_device_parse_register(cmx270_nand_mtd, NULL, NULL,
partition_info, NUM_PARTITIONS);
ret = mtd_device_register(cmx270_nand_mtd, partition_info,
NUM_PARTITIONS);
if (ret)
goto err_scan;

View File

@ -310,8 +310,7 @@ static int __init cs553x_init(void)
for (i = 0; i < NR_CS553X_CONTROLLERS; i++) {
if (cs553x_mtd[i]) {
/* If any devices registered, return success. Else the last error. */
mtd_device_parse_register(cs553x_mtd[i], NULL, NULL,
NULL, 0);
mtd_device_register(cs553x_mtd[i], NULL, 0);
err = 0;
}
}

View File

@ -800,8 +800,7 @@ static int nand_davinci_probe(struct platform_device *pdev)
goto err;
if (pdata->parts)
ret = mtd_device_parse_register(mtd, NULL, NULL,
pdata->parts, pdata->nr_parts);
ret = mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
else
ret = mtd_device_register(mtd, NULL, 0);
if (ret < 0)

View File

@ -466,9 +466,8 @@ static int jz_nand_probe(struct platform_device *pdev)
goto err_unclaim_banks;
}
ret = mtd_device_parse_register(mtd, NULL, NULL,
pdata ? pdata->partitions : NULL,
pdata ? pdata->num_partitions : 0);
ret = mtd_device_register(mtd, pdata ? pdata->partitions : NULL,
pdata ? pdata->num_partitions : 0);
if (ret) {
dev_err(&pdev->dev, "Failed to add mtd device\n");

View File

@ -1357,7 +1357,7 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc,
if (ret)
return ret;
ret = mtd_device_parse_register(mtd, NULL, NULL, NULL, 0);
ret = mtd_device_register(mtd, NULL, 0);
if (ret) {
dev_err(dev, "mtd parse partition error\n");
nand_release(mtd);

View File

@ -802,8 +802,8 @@ static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info,
mtdinfo->name = set->name;
return mtd_device_parse_register(mtdinfo, NULL, NULL,
set->partitions, set->nr_partitions);
return mtd_device_register(mtdinfo, set->partitions,
set->nr_partitions);
}
return -ENODEV;

View File

@ -366,7 +366,7 @@ static int __init txx9ndfmc_probe(struct platform_device *dev)
}
mtd->name = txx9_priv->mtdname;
mtd_device_parse_register(mtd, NULL, NULL, NULL, 0);
mtd_device_register(mtd, NULL, 0);
drvdata->mtds[i] = mtd;
}