]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mtd: rawnand: mpc5121: Check before clk_disable_unprepare() not needed
authorPhil Edworthy <phil.edworthy@renesas.com>
Thu, 12 May 2022 18:50:33 +0000 (19:50 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 16 May 2022 16:34:38 +0000 (18:34 +0200)
All code in clk_disable_unprepare() already checks the clk ptr using
IS_ERR_OR_NULL so there is no need to check it again before calling it.
A lot of other drivers already rely on this behaviour, so it's safe
to do so here.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220512185033.46901-1-phil.edworthy@renesas.com
drivers/mtd/nand/raw/mpc5121_nfc.c

index 5b9271b9c32655b4d4d8f2d972c3d478d7b3b6d9..800d774aed8ef5db5be95b7dc17e0921089239a6 100644 (file)
@@ -595,8 +595,7 @@ static void mpc5121_nfc_free(struct device *dev, struct mtd_info *mtd)
        struct nand_chip *chip = mtd_to_nand(mtd);
        struct mpc5121_nfc_prv *prv = nand_get_controller_data(chip);
 
-       if (prv->clk)
-               clk_disable_unprepare(prv->clk);
+       clk_disable_unprepare(prv->clk);
 
        if (prv->csreg)
                iounmap(prv->csreg);