[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1443193758-22071-5-git-send-email-boris.brezillon@free-electrons.com>
Date: Fri, 25 Sep 2015 17:09:17 +0200
From: Boris Brezillon <boris.brezillon@...e-electrons.com>
To: David Woodhouse <dwmw2@...radead.org>,
Brian Norris <computersforpeace@...il.com>,
linux-mtd@...ts.infradead.org,
Artem Bityutskiy <dedekind1@...il.com>,
Richard Weinberger <richard@....at>
Cc: Andrea Scian <rnd4@...e-tech.it>,
Bean Huo 霍斌斌 (beanhuo)
<beanhuo@...ron.com>,
Karl Zhang 张双锣 (karlzhang)
<karlzhang@...ron.com>,
Iwo Mergler <Iwo.Mergler@...commwireless.com>,
"Jeff Lauruhn (jlauruhn)" <jlauruhn@...ron.com>,
Stefan Roese <sr@...x.de>, linux-kernel@...r.kernel.org,
Boris Brezillon <boris.brezillon@...e-electrons.com>
Subject: [PATCH 4/5] mtd: nand: nandsim: implement ->get_status()
We need to implement a specific ->get_status() function to support
power-cut emulation.
Signed-off-by: Boris Brezillon <boris.brezillon@...e-electrons.com>
---
drivers/mtd/nand/nandsim.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index b16d70a..efd8763 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -347,7 +347,7 @@ struct nandsim {
/* NAND flash internal registers */
struct {
unsigned command; /* the command register */
- u_char status; /* the status register */
+ int status; /* the status register */
uint row; /* the page number */
uint column; /* the offset within page */
uint count; /* internal counter */
@@ -2221,6 +2221,13 @@ static void ns_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
return;
}
+static int ns_nand_get_status(struct mtd_info *mtd)
+{
+ struct nandsim *ns = ((struct nand_chip *)mtd->priv)->priv;
+
+ return ns->regs.status;
+}
+
/*
* Module initialization function
*/
@@ -2256,6 +2263,7 @@ static int __init ns_init_module(void)
chip->write_buf = ns_nand_write_buf;
chip->read_buf = ns_nand_read_buf;
chip->read_word = ns_nand_read_word;
+ chip->get_status = ns_nand_get_status;
chip->ecc.mode = NAND_ECC_SOFT;
/* The NAND_SKIP_BBTSCAN option is necessary for 'overridesize' */
/* and 'badblocks' parameters to work */
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists