From patchwork Thu Apr 2 08:37:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 237101 List-Id: U-Boot discussion From: noltari at gmail.com (=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?=) Date: Thu, 2 Apr 2020 10:37:52 +0200 Subject: [PATCH] nand: brcmnand: return without disabling clock Message-ID: <20200402083752.14077-1-noltari@gmail.com> Linux Broadcom NAND driver only disabled clock if no childs are initialized. This section of the code seems to have been accidentally dropped when it was imported in U-Boot. Signed-off-by: ?lvaro Fern?ndez Rojas Reviewed-by: Daniel Schwierzeck --- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index 5232328e1e..7bdebf5869 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -2714,6 +2714,14 @@ int brcmnand_probe(struct udevice *dev, struct brcmnand_soc *soc) } #endif /* __UBOOT__ */ + /* No chip-selects could initialize properly */ + if (list_empty(&ctrl->host_list)) { + ret = -ENODEV; + goto err; + } + + return 0; + err: #ifndef __UBOOT__ clk_disable_unprepare(ctrl->clk); @@ -2722,7 +2730,6 @@ err: clk_disable(ctrl->clk); #endif /* __UBOOT__ */ return ret; - } EXPORT_SYMBOL_GPL(brcmnand_probe);