aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/mtd
diff options
context:
space:
mode:
authorPhil Edworthy <phil.edworthy@renesas.com>2022-05-12 19:50:33 +0100
committerMiquel Raynal <miquel.raynal@bootlin.com>2022-05-16 18:34:38 +0200
commit5794465b6fcfbaed304c8ebe8990f858eb2ed9a2 (patch)
tree2d988766bace2e1dcba8594f63ffe1be3986a33c /drivers/mtd
parentmtd: rawnand: rockchip: Check before clk_disable_unprepare() not needed (diff)
downloadwireguard-linux-5794465b6fcfbaed304c8ebe8990f858eb2ed9a2.tar.xz
wireguard-linux-5794465b6fcfbaed304c8ebe8990f858eb2ed9a2.zip
mtd: rawnand: mpc5121: Check before clk_disable_unprepare() not needed
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
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/mpc5121_nfc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/nand/raw/mpc5121_nfc.c b/drivers/mtd/nand/raw/mpc5121_nfc.c
index 5b9271b9c326..800d774aed8e 100644
--- a/drivers/mtd/nand/raw/mpc5121_nfc.c
+++ b/drivers/mtd/nand/raw/mpc5121_nfc.c
@@ -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);