All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Chuanhong Guo <gch981213@gmail.com>,
	linux-mtd@lists.infradead.org,
	Boris Brezillon <bbrezillon@kernel.org>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] mtd: nand: spi: rework detect procedure for different read id op
Date: Fri, 10 Jan 2020 09:10:24 +0100	[thread overview]
Message-ID: <20200110091024.56918193@xps13> (raw)
In-Reply-To: <20200110090422.75988c49@collabora.com>

Hi Boris,

Boris Brezillon <boris.brezillon@collabora.com> wrote on Fri, 10 Jan
2020 09:04:22 +0100:

> On Fri, 10 Jan 2020 15:34:28 +0800
> Chuanhong Guo <gch981213@gmail.com> wrote:
> 
> > Hi!
> > 
> > On Fri, Jan 10, 2020 at 2:59 PM Boris Brezillon
> > <boris.brezillon@collabora.com> wrote:  
> > > [...]    
> > > > +     ret = spinand_read_id_op(spinand, 1, 0, id);
> > > > +     if (ret)
> > > > +             return ret;
> > > > +     ret = spinand_manufacturer_match(spinand,
> > > > +                                      SPINAND_READID_METHOD_OPCODE_ADDR);
> > > > +     if (!ret)
> > > > +             return 0;
> > > > +
> > > > +     ret = spinand_read_id_op(spinand, 0, 1, id);    
> > >
> > > Hm, we should probably do only one of each read_id and iterate over all
> > > manufacturers/chips each time instead of doing 3 read_ids per
> > > manufacturer.    
> > 
> > This actually do the former instead of the latter. Maybe the function
> > names are a bit
> > misleading. spinand_manufacturer_match iterates over all manufacturers
> > in one call,
> > and spinand_manufacturer_detect is called once in spinand_detect.
> > Do you have suggestions on function naming?  
> 
> Maybe you can just inline the content of this function in
> spinand_detect().

Actually I found that part clear enough, I would keep it as is, out of
the spinand_detect() function as long as there is no actual reason to
merge them?

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Richard Weinberger <richard@nod.at>,
	open list <linux-kernel@vger.kernel.org>,
	linux-mtd@lists.infradead.org,
	Chuanhong Guo <gch981213@gmail.com>
Subject: Re: [PATCH v2] mtd: nand: spi: rework detect procedure for different read id op
Date: Fri, 10 Jan 2020 09:10:24 +0100	[thread overview]
Message-ID: <20200110091024.56918193@xps13> (raw)
In-Reply-To: <20200110090422.75988c49@collabora.com>

Hi Boris,

Boris Brezillon <boris.brezillon@collabora.com> wrote on Fri, 10 Jan
2020 09:04:22 +0100:

> On Fri, 10 Jan 2020 15:34:28 +0800
> Chuanhong Guo <gch981213@gmail.com> wrote:
> 
> > Hi!
> > 
> > On Fri, Jan 10, 2020 at 2:59 PM Boris Brezillon
> > <boris.brezillon@collabora.com> wrote:  
> > > [...]    
> > > > +     ret = spinand_read_id_op(spinand, 1, 0, id);
> > > > +     if (ret)
> > > > +             return ret;
> > > > +     ret = spinand_manufacturer_match(spinand,
> > > > +                                      SPINAND_READID_METHOD_OPCODE_ADDR);
> > > > +     if (!ret)
> > > > +             return 0;
> > > > +
> > > > +     ret = spinand_read_id_op(spinand, 0, 1, id);    
> > >
> > > Hm, we should probably do only one of each read_id and iterate over all
> > > manufacturers/chips each time instead of doing 3 read_ids per
> > > manufacturer.    
> > 
> > This actually do the former instead of the latter. Maybe the function
> > names are a bit
> > misleading. spinand_manufacturer_match iterates over all manufacturers
> > in one call,
> > and spinand_manufacturer_detect is called once in spinand_detect.
> > Do you have suggestions on function naming?  
> 
> Maybe you can just inline the content of this function in
> spinand_detect().

Actually I found that part clear enough, I would keep it as is, out of
the spinand_detect() function as long as there is no actual reason to
merge them?

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2020-01-10  8:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10  2:51 [PATCH v2] mtd: nand: spi: rework detect procedure for different read id op Chuanhong Guo
2020-01-10  2:51 ` Chuanhong Guo
2020-01-10  6:58 ` Boris Brezillon
2020-01-10  6:58   ` Boris Brezillon
2020-01-10  7:34   ` Chuanhong Guo
2020-01-10  7:34     ` Chuanhong Guo
2020-01-10  8:04     ` Boris Brezillon
2020-01-10  8:04       ` Boris Brezillon
2020-01-10  8:10       ` Miquel Raynal [this message]
2020-01-10  8:10         ` Miquel Raynal
2020-01-10  8:21         ` Boris Brezillon
2020-01-10  8:21           ` Boris Brezillon

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=20200110091024.56918193@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=bbrezillon@kernel.org \
    --cc=boris.brezillon@collabora.com \
    --cc=gch981213@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /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.