On Saturday, July 07, 2018 08:36 AM, Boris Brezillon wrote: > On Sat, 7 Jul 2018 08:28:52 +0200 > Daniel Mack <daniel at zonque.org> wrote: >> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c >> index e72070fe8af9..9246c3ea6ebc 100644 >> --- a/drivers/mtd/nand/raw/marvell_nand.c >> +++ b/drivers/mtd/nand/raw/marvell_nand.c >> @@ -2752,15 +2752,19 @@ static int marvell_nfc_probe(struct platform_device *pdev) >> return ret; >> >> nfc->reg_clk = devm_clk_get(&pdev->dev, "reg"); >> - if (PTR_ERR(nfc->reg_clk) != -ENOENT) { >> - if (!IS_ERR(nfc->reg_clk)) { >> - ret = clk_prepare_enable(nfc->reg_clk); >> - if (ret) >> - goto unprepare_core_clk; >> - } else { >> + if (IS_ERR(nfc->reg_clk)) { >> + if (PTR_ERR(nfc->reg_clk) != -ENOENT) { >> ret = PTR_ERR(nfc->reg_clk); >> goto unprepare_core_clk; >> } >> + >> + nfc->reg_clk = NULL; >> + } >> + >> + if (nfc->reg_clk) { >> + ret = clk_prepare_enable(nfc->reg_clk); >> + if (ret) >> + goto unprepare_core_clk; > > No need to check nfc->reg_clk value here: > > ret = clk_prepare_enable(nfc->reg_clk); > if (ret) > goto unprepare_core_clk; Ah, true.