summaryrefslogtreecommitdiff
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorMarc Gonzalez <marc_gonzalez@sigmadesigns.com>2016-07-27 12:23:52 +0300
committerBoris Brezillon <boris.brezillon@free-electrons.com>2016-09-23 10:35:16 +0300
commitd45bc58dd3bdcaabc1d7d8d9b0b8dee826635cc6 (patch)
treea2ba9413cf9dcaeff353b9a065e5db3fab2651ae /include/linux/mtd
parent29b4817d4018df78086157ea3a55c1d9424a7cfc (diff)
downloadlinux-d45bc58dd3bdcaabc1d7d8d9b0b8dee826635cc6.tar.xz
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 <marc_gonzalez@sigmadesigns.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/nand.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 8dd6e01f45c0..f6a2d5e7313c 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -460,6 +460,13 @@ struct nand_hw_control {
wait_queue_head_t wq;
};
+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_ctrl - Control structure for ECC
* @mode: ECC mode