mtd: onenand: use mtd_device_register() where applicable
authorRafał Miłecki <rafal@milecki.pl>
Fri, 13 Jul 2018 09:27:32 +0000 (11:27 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 19 Jul 2018 21:14:12 +0000 (23:14 +0200)
If driver doesn't specify parsers it can use that little helper.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/onenand/generic.c
drivers/mtd/nand/onenand/samsung.c

index d5ccaf943b91f710fde971442cc5c5b4be74dea0..acad17ec6581a247f3377b27024cdb839a75a0a1 100644 (file)
@@ -66,9 +66,8 @@ static int generic_onenand_probe(struct platform_device *pdev)
                goto out_iounmap;
        }
 
-       err = mtd_device_parse_register(&info->mtd, NULL, NULL,
-                                       pdata ? pdata->parts : NULL,
-                                       pdata ? pdata->nr_parts : 0);
+       err = mtd_device_register(&info->mtd, pdata ? pdata->parts : NULL,
+                                 pdata ? pdata->nr_parts : 0);
 
        platform_set_drvdata(pdev, info);
 
index 4cce4c0311ca440c7e57c482a9866c84b3d63f5a..e64d0fdf7eb5a503d94476be04966cbbe9407504 100644 (file)
@@ -933,9 +933,8 @@ static int s3c_onenand_probe(struct platform_device *pdev)
        if (s3c_read_reg(MEM_CFG_OFFSET) & ONENAND_SYS_CFG1_SYNC_READ)
                dev_info(&onenand->pdev->dev, "OneNAND Sync. Burst Read enabled\n");
 
-       err = mtd_device_parse_register(mtd, NULL, NULL,
-                                       pdata ? pdata->parts : NULL,
-                                       pdata ? pdata->nr_parts : 0);
+       err = mtd_device_register(mtd, pdata ? pdata->parts : NULL,
+                                 pdata ? pdata->nr_parts : 0);
        if (err) {
                dev_err(&pdev->dev, "failed to parse partitions and register the MTD device\n");
                onenand_release(mtd);