From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWH4k-0006nO-Fr for linux-mtd@lists.infradead.org; Mon, 10 Dec 2018 08:38:03 +0000 Date: Mon, 10 Dec 2018 09:37:41 +0100 From: Boris Brezillon To: Vignesh R Cc: Tudor Ambarus , Marek Vasut , Yogesh Narayan Gaur , Miquel Raynal , David Woodhouse , Brian Norris , Richard Weinberger , Subject: Re: [RFC PATCH 09/34] mtd: spi-nor: Add a flag to skip spi_nor_setup() Message-ID: <20181210093741.76fd0234@bbrezillon> In-Reply-To: References: <20181207092637.18687-1-boris.brezillon@bootlin.com> <20181207092637.18687-10-boris.brezillon@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 10 Dec 2018 14:00:59 +0530 Vignesh R wrote: > On 07/12/18 2:56 PM, Boris Brezillon wrote: > > Some manufacturers select the opcode to use in their fixups() > > method, and they don't want the generic selection logic to override > > their values. Add a flag to allow that. > > > > Signed-off-by: Boris Brezillon > > --- > > drivers/mtd/spi-nor/spi-nor.c | 7 +++++++ > > include/linux/mtd/spi-nor.h | 1 + > > 2 files changed, 8 insertions(+) > > > > diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c > > index f6b1c9b8079a..30dbddabec74 100644 > > --- a/drivers/mtd/spi-nor/spi-nor.c > > +++ b/drivers/mtd/spi-nor/spi-nor.c > > @@ -3502,6 +3502,13 @@ static int spi_nor_setup(struct spi_nor *nor, > > u32 ignored_mask, shared_mask; > > int err; > > > > + /* > > + * Some manufacturers select the opcode to use in their fixups() > > + * method, and explicitly ask to skip the generic selection logic. > > + */ > > + if (nor->flags & SNOR_F_SKIP_SETUP) > > + return 0; > > + > > Nit, I would suggest moving above check to the place where > spi_nor_setup() is called in spi_nor_scan(). That way, its easier to > know that setup is skipped when SNOR_F_SKIP_SETUP is set when reading > spi_nor_scan() code. I agree. Will change that in v2.