Linux-mtd Archive on lore.kernel.org
 help / color / Atom feed
From: <Tudor.Ambarus@microchip.com>
To: <vigneshr@ti.com>, <miquel.raynal@bootlin.com>, <richard@nod.at>
Cc: marek.vasut@gmail.com, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org, tmaimon77@gmail.com,
	bbrezillon@kernel.org
Subject: Re: [PATCH v4 2/3] mtd: spi-nor: Move m25p80 code in spi-nor.c
Date: Mon, 5 Aug 2019 10:25:41 +0000
Message-ID: <852ffdd1-a546-03db-3b60-47d60bd8d7cf@microchip.com> (raw)
In-Reply-To: <20190801162229.28897-3-vigneshr@ti.com>



On 08/01/2019 07:22 PM, Vignesh Raghavendra wrote:

> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> index e02376e1127b..866962c715b4 100644
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -19,6 +19,7 @@

cut

> +static ssize_t spi_nor_spimem_read_data(struct spi_nor *nor, loff_t from,
> +					size_t len, u8 *buf)
> +{
> +	struct spi_mem_op op =
> +		SPI_MEM_OP(SPI_MEM_OP_CMD(nor->read_opcode, 1),
> +			   SPI_MEM_OP_ADDR(nor->addr_width, from, 1),
> +			   SPI_MEM_OP_DUMMY(nor->read_dummy, 1),
> +			   SPI_MEM_OP_DATA_IN(len, buf, 1));
> +
> +	/* get transfer protocols. */
> +	op.cmd.buswidth = spi_nor_get_protocol_inst_nbits(nor->read_proto);
> +	op.addr.buswidth = spi_nor_get_protocol_addr_nbits(nor->read_proto);

nit: op.dummy.buswidth = op.addr.buswidth;

cut

>  
> @@ -688,6 +1003,16 @@ static int spi_nor_erase_sector(struct spi_nor *nor, u32 addr)
>  	if (nor->erase)
>  		return nor->erase(nor, addr);
>  
> +	if (nor->spimem) {
> +		struct spi_mem_op op =
> +			SPI_MEM_OP(SPI_MEM_OP_CMD(nor->erase_opcode, 1),
> +				   SPI_MEM_OP_ADDR(nor->addr_width, addr, 1),
> +				   SPI_MEM_OP_NO_DUMMY,
> +				   SPI_MEM_OP_NO_DATA);
> +
> +		return spi_mem_exec_op(nor->spimem, &op);
> +	}
> +

this should be done below in the function, after masking the address.

You add a double space after return in:
> +	return  nor->read_reg(nor, SPINOR_OP_RDSR2, sr2, 1);

There are some checkpatch warnings that we can fix now.

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

  reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 16:22 [PATCH v4 0/3] Merge m25p80 into spi-nor Vignesh Raghavendra
2019-08-01 16:22 ` [PATCH v4 1/3] mtd: spi-nor: always use bounce buffer for register read/writes Vignesh Raghavendra
2019-08-05  9:06   ` Tudor.Ambarus
2019-08-05 10:38     ` Vignesh Raghavendra
2019-08-05 11:24       ` Tudor.Ambarus
2019-08-01 16:22 ` [PATCH v4 2/3] mtd: spi-nor: Move m25p80 code in spi-nor.c Vignesh Raghavendra
2019-08-05 10:25   ` Tudor.Ambarus [this message]
2019-08-05 11:10     ` Vignesh Raghavendra
2019-08-05 11:51       ` Tudor.Ambarus
2019-08-05 12:31         ` Vignesh Raghavendra
2019-08-01 16:22 ` [PATCH v4 3/3] mtd: spi-nor: Rework hwcaps selection for the spi-mem case Vignesh Raghavendra
2019-08-05 17:45   ` Tudor.Ambarus

Reply instructions:

You may reply publically 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=852ffdd1-a546-03db-3b60-47d60bd8d7cf@microchip.com \
    --to=tudor.ambarus@microchip.com \
    --cc=bbrezillon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=tmaimon77@gmail.com \
    --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

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org
	public-inbox-index linux-mtd

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git