Merge "ipq40xx: nand: Initialize nand flash device before flashing"
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index a6b67e2..190275d 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -415,7 +415,8 @@
 		}
 
 		dev = (int)simple_strtoul(argv[2], NULL, 10);
-		set_dev(dev);
+		if (set_dev(dev))
+			return 1;
 
 		return 0;
 	}