RE: [PATCH V4 5/9] mtd: replace the hardcode with the onfi_feature()

Gupta, Pekon
2013-05-02T05:42:53Z

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1166 bytes --]

> >> - *busw = 0;
> >> - if (le16_to_cpu(p->features)& 1)
> >> - *busw = NAND_BUSWIDTH_16;
> >> +
> >> + *busw = (onfi_feature(chip)& ONFI_FEATURE_16_BIT_BUS) ?
> >> + NAND_BUSWIDTH_16 : 0;
> > Is this really needed ? you have already checked the 'onfi_version'
> above in
> > nand_flash_detect_onfi() ..
> > if (!chip->onfi_version) {
> > pr_info("%s: unsupported ONFI version: %d\n",
> __func__, val);
> > 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.
>

[Pekon]: [Patch 3/9]: add a helper to get the supported features
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;

with regards, pekon
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éÝ¶\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dÊ‡Ú™ë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥