lkml.org 
[lkml]   [2013]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V4 5/9] mtd: replace the hardcode with the onfi_feature()
于 2013年05月02日 13:42, Gupta, Pekon 写道:
>>>> - *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;
yes. for this function, it's enough.

But we may use the onfi_feature() in other places, such as some drivers. That's reason why i added this helper.



thanks
Huang Shijie










--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-05-02 08:41    [W:0.062 / U:3.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site