[v2,2/4] nand: raw: zynq: Do not try to probe driver if nand flash is disabled
diff mbox series

Message ID 34105b3d468216b08107d367d83fd9e9975d3459.1582713521.git.michal.simek@xilinx.com
State New
Delegated to: Michal Simek
Headers show
Series
  • ARM: zynq: Switch to CFI DM driver
Related show

Commit Message

Michal Simek Feb. 26, 2020, 10:38 a.m. UTC
There is no reason to continue when DT status property indicates that NAND
flash is disabled. But that means that NOR flash should be present that's
why try it find it out.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Changes in v2: None

 drivers/mtd/nand/raw/zynq_nand.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Jagan Teki April 3, 2020, 2:44 p.m. UTC | #1
On Wed, Feb 26, 2020 at 4:09 PM Michal Simek <michal.simek@xilinx.com> wrote:
>
> There is no reason to continue when DT status property indicates that NAND
> flash is disabled. But that means that NOR flash should be present that's
> why try it find it out.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

Patch
diff mbox series

diff --git a/drivers/mtd/nand/raw/zynq_nand.c b/drivers/mtd/nand/raw/zynq_nand.c
index 703914969289..0aea83dac0e6 100644
--- a/drivers/mtd/nand/raw/zynq_nand.c
+++ b/drivers/mtd/nand/raw/zynq_nand.c
@@ -1090,6 +1090,11 @@  static int zynq_nand_probe(struct udevice *dev)
 		return -ENODEV;
 	}
 
+	if (!ofnode_is_available(of_nand)) {
+		debug("Nand node in dt disabled\n");
+		return dm_scan_fdt_dev(dev);
+	}
+
 	if (ofnode_read_resource(of_nand, 0, &res)) {
 		printf("Failed to get nand resource\n");
 		return -ENODEV;