summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorPhil Edworthy <phil.edworthy@renesas.com>2022-05-12 19:45:58 +0100
committerMiquel Raynal <miquel.raynal@bootlin.com>2022-05-16 18:34:36 +0200
commit6879854d16341ab67d61580fa988ad1b7e7cc040 (patch)
tree9faf8b05e3d9ffc6949c29cc37829497a75084a4 /drivers/mtd
parent66d7a40beb413815a5b1adbc1558200f5b18d817 (diff)
downloadlinux-stable-6879854d16341ab67d61580fa988ad1b7e7cc040.tar.gz
linux-stable-6879854d16341ab67d61580fa988ad1b7e7cc040.tar.bz2
linux-stable-6879854d16341ab67d61580fa988ad1b7e7cc040.zip
mtd: rawnand: rockchip: 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/20220512184558.45966-1-phil.edworthy@renesas.com
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/rockchip-nand-controller.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/nand/raw/rockchip-nand-controller.c b/drivers/mtd/nand/raw/rockchip-nand-controller.c
index cbaa4f1c83da..f133985cc053 100644
--- a/drivers/mtd/nand/raw/rockchip-nand-controller.c
+++ b/drivers/mtd/nand/raw/rockchip-nand-controller.c
@@ -911,8 +911,7 @@ static int rk_nfc_enable_clks(struct device *dev, struct rk_nfc *nfc)
ret = clk_prepare_enable(nfc->ahb_clk);
if (ret) {
dev_err(dev, "failed to enable ahb clk\n");
- if (!IS_ERR(nfc->nfc_clk))
- clk_disable_unprepare(nfc->nfc_clk);
+ clk_disable_unprepare(nfc->nfc_clk);
return ret;
}
@@ -921,8 +920,7 @@ static int rk_nfc_enable_clks(struct device *dev, struct rk_nfc *nfc)
static void rk_nfc_disable_clks(struct rk_nfc *nfc)
{
- if (!IS_ERR(nfc->nfc_clk))
- clk_disable_unprepare(nfc->nfc_clk);
+ clk_disable_unprepare(nfc->nfc_clk);
clk_disable_unprepare(nfc->ahb_clk);
}