[PATCH 2/3] mtd: spi-nor: remove the jedec_id/ext_id

Huang Shijie shijie.huang at intel.com
Wed Nov 5 17:09:20 PST 2014


On Wed, Nov 05, 2014 at 10:35:09PM +0100, Rafał Miłecki wrote:
> On 5 November 2014 12:16, Brian Norris <computersforpeace at gmail.com> wrote:
> > On Tue, Aug 12, 2014 at 08:54:55AM +0800, Huang Shijie wrote:
> >> The "id" array contains all the information about the JEDEC and the
> >> manufacturer ID info, this patch remove the jedec_id/ext_id from the
> >> flash_info.
> >>
> >> Signed-off-by: Huang Shijie <shijie.huang at intel.com>
> >
> > This patch does not apply any more. Can you rebase?
> 
> Hm, I've just noticed that my patch:
> "prefer more specific entries from chips database"
> http://patchwork.ozlabs.org/patch/401907/
> conflicts with this one.
> 
> I think the final solution (after somehow applying both patches)
> should be something like:
> for (len = 6; i >= 4; len--) {
>     for (tmp = 0; tmp < ARRAY_SIZE(spi_nor_ids) - 1; tmp++) {
>         if (tmp->id_len == len && !strncmp(info->id, id, info->id_len)
>             return &spi_nor_ids[tmp];
>     }
> }
> 
> Does it make sense to you?
sorry, I can not understand this code. could you please give me a full
patch for your idea? thanks

> 
> Huang: I think it'll be the most optimal to me rebase my patch on top
> on your ones.
It is okay. I will CC to you with the new patch.
> 
> Btw. I have two comments regarding 1/3 (can't find it to reply properly):
> 
> 1) Do we need the if (info->id_len) check?
yes. some chips may have short info->id_len, some chips may have long
info->id_len.

> 2) Shouldn't we use memcmp in the if (!strncmp(info->id, id, info->id_len))
I prefer to memcmp too. But i misused with strncmp.
You can send a patch to fix it. I can give you my Ack. :)

thanks
Huang Shiji




More information about the linux-mtd mailing list