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:

committed by
Boris Brezillon

parent
29b4817d40
commit
d45bc58dd3
@@ -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
|
||||
|
Reference in New Issue
Block a user