summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMarc Gonzalez <[email protected]>2019-03-15 15:14:31 +0100
committerTom Rini <[email protected]>2019-04-22 11:55:58 -0400
commit5df42b0603d50ea59e1039b31fe74c1309abdd3a (patch)
treea74c31d0832b2a51a1e065aed88989f43b360d8f /include/linux
parent892a8682f71910aa12647c5636ec5304225c9e0f (diff)
mtd: nand: import nand_hw_control_init()
Linux commit d45bc58dd3b ("mtd: nand: import nand_hw_control_init()") The code to initialize a struct nand_hw_control is duplicated across several drivers. Factorize it using an inline function. Signed-off-by: Marc Gonzalez <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> [Philippe Reynes: adapt code to u-boot and only keep new function] Signed-off-by: Philippe Reynes <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/rawnand.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index e2bd5982402..96b584704b5 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -499,6 +499,13 @@ struct nand_hw_control {
struct nand_chip *active;
};
+static inline void nand_hw_control_init(struct nand_hw_control *nfc)
+{
+ nfc->active = NULL;
+ spin_lock_init(&nfc->lock);
+ init_waitqueue_head(&nfc->wq);
+}
+
/**
* struct nand_ecc_step_info - ECC step information of ECC engine
* @stepsize: data bytes per ECC step