|
@@ -2709,7 +2709,9 @@ static int nand_onfi_set_features(struct mtd_info *mtd, struct nand_chip *chip,
|
|
|
{
|
|
|
int status;
|
|
|
|
|
|
- if (!chip->onfi_version)
|
|
|
+ if (!chip->onfi_version ||
|
|
|
+ !(le16_to_cpu(chip->onfi_params.opt_cmd)
|
|
|
+ & ONFI_OPT_CMD_SET_GET_FEATURES))
|
|
|
return -EINVAL;
|
|
|
|
|
|
chip->cmdfunc(mtd, NAND_CMD_SET_FEATURES, addr, -1);
|
|
@@ -2730,7 +2732,9 @@ static int nand_onfi_set_features(struct mtd_info *mtd, struct nand_chip *chip,
|
|
|
static int nand_onfi_get_features(struct mtd_info *mtd, struct nand_chip *chip,
|
|
|
int addr, uint8_t *subfeature_param)
|
|
|
{
|
|
|
- if (!chip->onfi_version)
|
|
|
+ if (!chip->onfi_version ||
|
|
|
+ !(le16_to_cpu(chip->onfi_params.opt_cmd)
|
|
|
+ & ONFI_OPT_CMD_SET_GET_FEATURES))
|
|
|
return -EINVAL;
|
|
|
|
|
|
/* clear the sub feature parameters */
|