From: Huang Shijie <b32955@freescale.com>
To: Angus Clark <angus.clark@st.com>
Cc: Marek Vasut <marex@denx.de>,
Brian Norris <computersforpeace@gmail.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH] mtd: m25p80: add support for Spansion s25fl128s chip
Date: Fri, 6 Dec 2013 18:02:22 +0800 [thread overview]
Message-ID: <20131206100220.GA16069@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <52A05BA6.9080800@st.com>
On Thu, Dec 05, 2013 at 10:55:34AM +0000, Angus Clark wrote:
> static struct flash_info *__devinit fsm_jedec_probe(struct stm_spi_fsm *fsm)
> {
> uint8_t readid[MAX_READID_LEN];
How long is the MAX_READID_LEN? 5 or 8?
Brian doubt that some NOR can not be read out more then 5 bytes.
> char readid_str[MAX_READID_LEN * 3 + 1];
> struct flash_info *info;
>
> if (fsm_read_jedec(fsm, readid) != 0) {
> dev_info(fsm->dev, "error reading JEDEC ID\n");
> return NULL;
> }
>
> hex_dump_to_buffer(readid, MAX_READID_LEN, 16, 1,
> readid_str, sizeof(readid_str), 0);
>
> dev_dbg(fsm->dev, "READID = %s\n", readid_str);
>
> /* The 'readid' may match multiple entries in the table. To ensure we
> * retrieve the most specific match, the table is sorted in order of
> * 'readid_len'.
> */
> sort(flash_types, ARRAY_SIZE(flash_types) - 1,
> sizeof(struct flash_info), cmp_flash_info_readid_len, NULL);
>
If we keep the flash_types table be inserted by a specific order.
We can remove this sort code.
> for (info = flash_types; info->name; info++) {
> if (memcmp(info->readid, readid, info->readid_len) == 0)
> return info;
> }
>
thanks
Huang Shijie
next prev parent reply other threads:[~2013-12-06 10:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 8:52 [PATCH] mtd: m25p80: add support for Spansion s25fl128s chip Huang Shijie
2013-11-20 9:30 ` Marek Vasut
2013-11-20 10:16 ` Angus Clark
2013-11-21 8:18 ` Huang Shijie
2013-11-21 9:17 ` Angus Clark
2013-11-21 9:48 ` Huang Shijie
2013-11-21 11:08 ` Angus Clark
[not found] ` <528EBDAE.7070408@freescale.com>
2013-12-04 23:58 ` Brian Norris
2013-12-05 2:20 ` Huang Shijie
2013-12-05 2:51 ` Brian Norris
2013-12-05 10:55 ` Angus Clark
2013-12-06 10:02 ` Huang Shijie [this message]
2013-12-09 8:52 ` Angus Clark
2013-12-12 4:17 ` Huang Shijie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131206100220.GA16069@shlinux2.ap.freescale.net \
--to=b32955@freescale.com \
--cc=angus.clark@st.com \
--cc=computersforpeace@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=marex@denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.