Added support for the TQM8272 board from TQ

Signed-off-by: Heiko Schocher <hs@denx.de>
diff --git a/drivers/nand/nand.c b/drivers/nand/nand.c
index 3899045..9fef71d 100644
--- a/drivers/nand/nand.c
+++ b/drivers/nand/nand.c
@@ -39,7 +39,7 @@
 
 static const char default_nand_name[] = "nand";
 
-extern void board_nand_init(struct nand_chip *nand);
+extern int board_nand_init(struct nand_chip *nand);
 
 static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand,
 			   ulong base_addr)
@@ -47,13 +47,16 @@
 	mtd->priv = nand;
 
 	nand->IO_ADDR_R = nand->IO_ADDR_W = (void  __iomem *)base_addr;
-	board_nand_init(nand);
-
-	if (nand_scan(mtd, 1) == 0) {
-		if (!mtd->name)
-			mtd->name = (char *)default_nand_name;
-	} else
+	if (board_nand_init(nand) == 0) {
+		if (nand_scan(mtd, 1) == 0) {
+			if (!mtd->name)
+				mtd->name = (char *)default_nand_name;
+		} else
+			mtd->name = NULL;
+	} else {
 		mtd->name = NULL;
+		mtd->size = 0;
+	}
 
 }