[U-Boot] [PATCH 2/2] nand: zynq: Cleanup initialization
Michal Simek
michal.simek at xilinx.com
Thu Apr 19 11:10:10 UTC 2018
From: Ezequiel Garcia <ezequiel at vanguardiasur.com.ar>
CONFIG_NAND_ZYNQ selects CONFIG_SYS_NAND_SELF_INIT, so the
driver doesn't have to play any ifdef game.
Also, we can mark zynq_nand_init() as static and get rid
of the mach-specific nand.h header.
This is really a revert of:
"mtd: zynq: nand: Move board_nand_init() function to board.c"
(sha1: 310995d9f91ae56082b49be06fe8c3d01424f8f6)
Signed-off-by: Ezequiel Garcia <ezequiel at vanguardiasur.com.ar>
Reviewed-by: Michal Simek <michal.simek at xilinx.com>
Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---
arch/arm/mach-zynq/include/mach/nand.h | 9 ---------
drivers/mtd/nand/zynq_nand.c | 6 ++----
2 files changed, 2 insertions(+), 13 deletions(-)
delete mode 100644 arch/arm/mach-zynq/include/mach/nand.h
diff --git a/arch/arm/mach-zynq/include/mach/nand.h b/arch/arm/mach-zynq/include/mach/nand.h
deleted file mode 100644
index 61ef45f5828a..000000000000
--- a/arch/arm/mach-zynq/include/mach/nand.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Copyright (C) 2017 National Instruments Corp.
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <nand.h>
-
-void zynq_nand_init(void);
diff --git a/drivers/mtd/nand/zynq_nand.c b/drivers/mtd/nand/zynq_nand.c
index 9f6ff3d045c2..2d4e8b4736ba 100644
--- a/drivers/mtd/nand/zynq_nand.c
+++ b/drivers/mtd/nand/zynq_nand.c
@@ -1006,7 +1006,7 @@ static int zynq_nand_device_ready(struct mtd_info *mtd)
return 0;
}
-int zynq_nand_init(struct nand_chip *nand_chip, int devnum)
+static int zynq_nand_init(struct nand_chip *nand_chip, int devnum)
{
struct zynq_nand_info *xnand;
struct mtd_info *mtd;
@@ -1192,14 +1192,12 @@ fail:
return err;
}
-#ifdef CONFIG_SYS_NAND_SELF_INIT
static struct nand_chip nand_chip[CONFIG_SYS_MAX_NAND_DEVICE];
-void __weak board_nand_init(void)
+void board_nand_init(void)
{
struct nand_chip *nand = &nand_chip[0];
if (zynq_nand_init(nand, 0))
puts("ZYNQ NAND init failed\n");
}
-#endif
--
2.17.0
More information about the U-Boot
mailing list