mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Dec 16 11:59:09 PST 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=83f48f80de8a03c053ff0cac1521c1eaeaa107f2
Commit:     83f48f80de8a03c053ff0cac1521c1eaeaa107f2
Parent:     c75183020fca0229fce1fd6ba21ae840b41d79e9
Author:     Masahiro Yamada <yamada.masahiro at socionext.com>
AuthorDate: Fri Nov 4 19:43:10 2016 +0900
Committer:  Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Mon Nov 7 14:48:53 2016 +0100

    mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo
    
    For this driver, there is nothing between nand_scan_ident() and
    nand_scan_tail().  They can be merged into nand_scan().
    
    Also, nand_scan() returns an appropriate error value when it fails.
    Use it instead of the fixed error code -ENXIO.
    
    Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
    Reviewed-by: Marek Vasut <marek.vasut at gmail.com>
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
---
 drivers/mtd/nand/socrates_nand.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/mtd/nand/socrates_nand.c b/drivers/mtd/nand/socrates_nand.c
index 888fd31..72369bd 100644
--- a/drivers/mtd/nand/socrates_nand.c
+++ b/drivers/mtd/nand/socrates_nand.c
@@ -187,17 +187,9 @@ static int socrates_nand_probe(struct platform_device *ofdev)
 
 	dev_set_drvdata(&ofdev->dev, host);
 
-	/* first scan to find the device and get the page size */
-	if (nand_scan_ident(mtd, 1, NULL)) {
-		res = -ENXIO;
+	res = nand_scan(mtd, 1);
+	if (res)
 		goto out;
-	}
-
-	/* second phase scan */
-	if (nand_scan_tail(mtd)) {
-		res = -ENXIO;
-		goto out;
-	}
 
 	res = mtd_device_register(mtd, NULL, 0);
 	if (!res)



More information about the linux-mtd-cvs mailing list