Commit 6879854d authored by Phil Edworthy's avatar Phil Edworthy Committed by Miquel Raynal
Browse files

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: default avatarPhil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220512184558.45966-1-phil.edworthy@renesas.com
parent 66d7a40b
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -911,7 +911,6 @@ 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);
		return ret;
	}
@@ -921,7 +920,6 @@ 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->ahb_clk);
}