mtd: nand: fix GET/SET_FEATURES address on 16-bit devices
authorDavid Mosberger <davidm@egauge.net>
Fri, 21 Mar 2014 22:05:10 +0000 (16:05 -0600)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 26 Mar 2014 06:31:26 +0000 (23:31 -0700)
GET_FEATURES and SET_FEATURES also need byte-addressing on 16-bit devices.

Signed-off-by: David Mosberger <davidm@egauge.net>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
include/linux/mtd/nand.h

index 0747fef2bfc6682541ff97c0be1014ac6eb3b80f..450d61ec7f060982ff65bea2de2d35e275028877 100644 (file)
@@ -925,7 +925,16 @@ static inline bool nand_is_slc(struct nand_chip *chip)
  */
 static inline int nand_opcode_8bits(unsigned int command)
 {
-       return command == NAND_CMD_READID || command == NAND_CMD_PARAM;
+       switch (command) {
+       case NAND_CMD_READID:
+       case NAND_CMD_PARAM:
+       case NAND_CMD_GET_FEATURES:
+       case NAND_CMD_SET_FEATURES:
+               return 1;
+       default:
+               break;
+       }
+       return 0;
 }
 
 /* return the supported JEDEC features. */