nand: brcmnand: return without disabling clock
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Thu, 2 Apr 2020 08:37:52 +0000 (10:37 +0200)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Mon, 27 Apr 2020 18:29:33 +0000 (20:29 +0200)
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 <noltari@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
drivers/mtd/nand/raw/brcmnand/brcmnand.c

index 5232328e1e4a21308b8b8b29e14f2158d166cffb..7bdebf586994e50663d2fba07d94c07f1c021fbd 100644 (file)
@@ -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);