yes. for this function, it's enough.[Pekon]: [Patch 3/9]: add a helper to get the supported featuresabove in- *busw = 0;Is this really needed ? you have already checked the 'onfi_version'
- if (le16_to_cpu(p->features)& 1)
- *busw = NAND_BUSWIDTH_16;
+
+ *busw = (onfi_feature(chip)& ONFI_FEATURE_16_BIT_BUS) ?
+ NAND_BUSWIDTH_16 : 0;
nand_flash_detect_onfi() ..__func__, val);
if (!chip->onfi_version) {
pr_info("%s: unsupported ONFI version: %d\n",
return 0;I think checking the onfi_version has no relationship with this patch. :)
}
This patch is just replace the hardcode for 16-bit onfi nand check.
I mean, do you really need this helper function ?
+static inline int onfi_feature(struct nand_chip *chip)
+{
+ return chip->onfi_version ? le16_to_cpu(chip->onfi_params.features) : 0;
+ }
Following change should have been enough..
*busw = (le16_to_cpu(p->features)& ONFI_FEATURE_16_BIT_BUS) ?
NAND_BUSWIDTH_16 : 0;