public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: Boris Brezillon <boris.brezillon@bootlin.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	linux-mtd@lists.infradead.org
Subject: Re: [PATCH 2/2] mtd: m25p80: Use SPI_MEM_OP_NO_DUMMY instead of SPI_MEM_OP_DUMMY(0, x)
Date: Mon, 18 Jun 2018 11:41:15 +0200	[thread overview]
Message-ID: <b091249b-81b9-8924-73ac-6fdf4a9ecec7@gmail.com> (raw)
In-Reply-To: <20180601100325.11165-2-boris.brezillon@bootlin.com>

On 06/01/2018 12:03 PM, Boris Brezillon wrote:
> SPI_MEM_OP_DUMMY(0, x) means there's 0 dummy bytes to send, which is
> similar to SPI_MEM_OP_NO_DUMMY except it's less clear. Use
> SPI_MEM_OP_NO_DUMMY instead of SPI_MEM_OP_DUMMY(0, x) in
> m25p80_write().
> Also stop updating op.dummy.buswidth since this value is only
> meaningful if you have dummy bytes.
> 
> Reported-by: Cyrille Pitchen <cyrille.pitchen@microchip.com>
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>

Acked-by: Marek Vasut <marek.vasut@gmail.com>

> ---
>  drivers/mtd/devices/m25p80.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 73dd74330227..1dd5f0420b5a 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -68,7 +68,7 @@ static ssize_t m25p80_write(struct spi_nor *nor, loff_t to, size_t len,
>  	struct spi_mem_op op =
>  			SPI_MEM_OP(SPI_MEM_OP_CMD(nor->program_opcode, 1),
>  				   SPI_MEM_OP_ADDR(nor->addr_width, to, 1),
> -				   SPI_MEM_OP_DUMMY(0, 1),
> +				   SPI_MEM_OP_NO_DUMMY,
>  				   SPI_MEM_OP_DATA_OUT(len, buf, 1));
>  	size_t remaining = len;
>  	int ret;
> @@ -76,7 +76,6 @@ static ssize_t m25p80_write(struct spi_nor *nor, loff_t to, size_t len,
>  	/* get transfer protocols. */
>  	op.cmd.buswidth = spi_nor_get_protocol_inst_nbits(nor->write_proto);
>  	op.addr.buswidth = spi_nor_get_protocol_addr_nbits(nor->write_proto);
> -	op.dummy.buswidth = op.addr.buswidth;
>  	op.data.buswidth = spi_nor_get_protocol_data_nbits(nor->write_proto);
>  
>  	if (nor->program_opcode == SPINOR_OP_AAI_WP && nor->sst_write_second)
> 


-- 
Best regards,
Marek Vasut

  reply	other threads:[~2018-06-18  9:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01 10:03 [PATCH 1/2] mtd: m25p80: Remove unneeded m25p->command field Boris Brezillon
2018-06-01 10:03 ` [PATCH 2/2] mtd: m25p80: Use SPI_MEM_OP_NO_DUMMY instead of SPI_MEM_OP_DUMMY(0, x) Boris Brezillon
2018-06-18  9:41   ` Marek Vasut [this message]
2018-06-18  9:04 ` [PATCH 1/2] mtd: m25p80: Remove unneeded m25p->command field Boris Brezillon
2018-06-18  9:40 ` Marek Vasut
2018-06-19  5:45 ` 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=b091249b-81b9-8924-73ac-6fdf4a9ecec7@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox