mtd: nand: vf610: Check the return value from clk_prepare_enable()
authorFabio Estevam <fabio.estevam@nxp.com>
Tue, 18 Jul 2017 00:54:07 +0000 (21:54 -0300)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Wed, 23 Aug 2017 14:49:14 +0000 (16:49 +0200)
clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/vf610_nfc.c

index 744ab10e896218124c20486a201f8e6c88c9ac08..9e496727e7817cd920b69e9d7020c175e2494a2f 100644 (file)
@@ -814,12 +814,16 @@ static int vf610_nfc_suspend(struct device *dev)
 
 static int vf610_nfc_resume(struct device *dev)
 {
+       int err;
+
        struct mtd_info *mtd = dev_get_drvdata(dev);
        struct vf610_nfc *nfc = mtd_to_nfc(mtd);
 
        pinctrl_pm_select_default_state(dev);
 
-       clk_prepare_enable(nfc->clk);
+       err = clk_prepare_enable(nfc->clk);
+       if (err)
+               return err;
 
        vf610_nfc_preinit_controller(nfc);
        vf610_nfc_init_controller(nfc);