]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: m25p80: Fix the Spansion chip detection
authorMarek Vasut <marex@denx.de>
Fri, 6 Jul 2012 06:10:26 +0000 (08:10 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 24 Aug 2012 08:03:35 +0000 (11:03 +0300)
commit2f9eca8cdcc83e9df5e6f8fb0731dac4bc27001a
treee3e8702e15287d6ea72d11988bbce41e351a79a1
parentb2027c55c17d2665b370f17969f84caddf48445e
mtd: m25p80: Fix the Spansion chip detection

Due to the implementation of the following loop at the end
of jedec_probe():

776         for (tmp = 0; tmp < ARRAY_SIZE(m25p_ids) - 1; tmp++) {
777                 info = (void *)m25p_ids[tmp].driver_data;
778                 if (info->jedec_id == jedec) {
779                         if (info->ext_id != 0 && info->ext_id != ext_jedec)
780                                 continue;
781                         return &m25p_ids[tmp];
782                 }
783         }

In particular line 779 in the above numbering, the chips with ext_id != 0 must
be ordered first in the list of chips (m25p_ids[]).

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
drivers/mtd/devices/m25p80.c