lkml.org 
[lkml]   [2014]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 12/47] mtd: nand: stm_nand_bch: scan for NAND devices
Date
Use the core nand_scan_ident() routine to locate connected NAND chips.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mtd/nand/stm_nand_bch.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/mtd/nand/stm_nand_bch.c b/drivers/mtd/nand/stm_nand_bch.c
index e1ebf92..1de13bd 100644
--- a/drivers/mtd/nand/stm_nand_bch.c
+++ b/drivers/mtd/nand/stm_nand_bch.c
@@ -374,6 +374,7 @@ static int stm_nand_bch_probe(struct platform_device *pdev)
struct nandi_info *info;
struct nand_chip *chip;
struct mtd_info *mtd;
+ int err;

if (!pdata) {
dev_err(&pdev->dev, "no platform data found\n");
@@ -403,6 +404,10 @@ static int stm_nand_bch_probe(struct platform_device *pdev)

nandi_set_mtd_defaults(nandi, mtd, chip);

+ err = nand_scan_ident(mtd, 1, NULL);
+ if (err)
+ return err;
+
return 0;
}

@@ -410,6 +415,8 @@ static int stm_nand_bch_remove(struct platform_device *pdev)
{
struct nandi_controller *nandi = platform_get_drvdata(pdev);

+ nand_release(&nandi->info.mtd);
+
nandi_clk_disable(nandi);

return 0;
--
1.8.3.2


\
 
 \ /
  Last update: 2014-03-25 11:01    [W:0.350 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site