mtd: rawnand: mtk: Use nand_controller_init() instead of open-coding it
authorBoris Brezillon <boris.brezillon@bootlin.com>
Tue, 20 Nov 2018 10:57:16 +0000 (11:57 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 5 Feb 2019 14:39:39 +0000 (15:39 +0100)
nand_controller_init() has been added to simplify nand_controller
struct initialization. Use this function instead of duplicating the
logic.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/mtk_nand.c

index b6b4602f5132ebc7b9b3fe30daabd3094bd06ccf..2c0e091877738d2bb49ab4c483bcc848261821c7 100644 (file)
@@ -1451,8 +1451,7 @@ static int mtk_nfc_probe(struct platform_device *pdev)
        if (!nfc)
                return -ENOMEM;
 
-       spin_lock_init(&nfc->controller.lock);
-       init_waitqueue_head(&nfc->controller.wq);
+       nand_controller_init(&nfc->controller);
        INIT_LIST_HEAD(&nfc->chips);
        nfc->controller.ops = &mtk_nfc_controller_ops;