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>
This commit is contained in:
Marc Gonzalez 2016-07-27 11:23:52 +02:00 committed by Boris Brezillon
parent 29b4817d40
commit d45bc58dd3
14 changed files with 20 additions and 26 deletions

View file

@ -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