aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
authorDavid Mosberger <dmosberger@gmail.com>2013-05-29 08:30:13 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2013-08-05 15:49:04 -0400
commitd914c932d7764bf9633af974940aee9390adf20d (patch)
treeb08b576b48b297d925bf83e77619d1c0c4fbc8b1 /drivers/mtd/nand/nand_base.c
parent64ddba4d8a381b65bebee24c8da4eb80080c64a4 (diff)
mtd: nand_base: Only use GET/SET FEATURES command on chips that support them.
Spansion's S34MLx chips support ONFI but not the GET/SET FEATURES calls. Signed-off-by: David Mosberger <dmosberger@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r--drivers/mtd/nand/nand_base.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index edc7663f4b7b..1cbacffb5106 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2709,7 +2709,9 @@ static int nand_onfi_set_features(struct mtd_info *mtd, struct nand_chip *chip,
2709{ 2709{
2710 int status; 2710 int status;
2711 2711
2712 if (!chip->onfi_version) 2712 if (!chip->onfi_version ||
2713 !(le16_to_cpu(chip->onfi_params.opt_cmd)
2714 & ONFI_OPT_CMD_SET_GET_FEATURES))
2713 return -EINVAL; 2715 return -EINVAL;
2714 2716
2715 chip->cmdfunc(mtd, NAND_CMD_SET_FEATURES, addr, -1); 2717 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,
2730static int nand_onfi_get_features(struct mtd_info *mtd, struct nand_chip *chip, 2732static int nand_onfi_get_features(struct mtd_info *mtd, struct nand_chip *chip,
2731 int addr, uint8_t *subfeature_param) 2733 int addr, uint8_t *subfeature_param)
2732{ 2734{
2733 if (!chip->onfi_version) 2735 if (!chip->onfi_version ||
2736 !(le16_to_cpu(chip->onfi_params.opt_cmd)
2737 & ONFI_OPT_CMD_SET_GET_FEATURES))
2734 return -EINVAL; 2738 return -EINVAL;
2735 2739
2736 /* clear the sub feature parameters */ 2740 /* clear the sub feature parameters */