nand: k9f1g08: fail gracefully if no nand is present
authorSteve Sakoman <steve@sakoman.com>
Thu, 26 Aug 2010 03:58:39 +0000 (20:58 -0700)
committerSteve Sakoman <steve@sakoman.com>
Thu, 26 Aug 2010 03:58:39 +0000 (20:58 -0700)
drivers/k9f1g08r0a.c

index d2da804..e0b1af5 100644 (file)
@@ -211,8 +211,13 @@ int nand_chip()
             (mfr == K9F1G08R0A_MFR && (id == K9F1G08R0A_ID))) {
                return 0;
        } else {
-               printf("Unknown chip: mfr was 0x%02x, id was 0x%02x\n", mfr, id);
-               return 1;
+               if ((mfr == 0) && (id == 0)) {
+                       printf("No NAND detected\n");
+                       return 0;
+               } else {
+                       printf("Unknown chip: mfr was 0x%02x, id was 0x%02x\n", mfr, id);
+                       return 1;
+               }
        }
 }