All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: m25p80: Remove unneeded m25p->command field
@ 2018-06-01 10:03 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
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Boris Brezillon @ 2018-06-01 10:03 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, linux-mtd

The ->command field is no longer used, remove it.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
---
 drivers/mtd/devices/m25p80.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 3dc022d3b53e..73dd74330227 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -28,11 +28,9 @@
 #include <linux/spi/flash.h>
 #include <linux/mtd/spi-nor.h>
 
-#define	MAX_CMD_SIZE		6
 struct m25p {
 	struct spi_mem		*spimem;
 	struct spi_nor		spi_nor;
-	u8			command[MAX_CMD_SIZE];
 };
 
 static int m25p80_read_reg(struct spi_nor *nor, u8 code, u8 *val, int len)
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] mtd: m25p80: Use SPI_MEM_OP_NO_DUMMY instead of SPI_MEM_OP_DUMMY(0, x)
  2018-06-01 10:03 [PATCH 1/2] mtd: m25p80: Remove unneeded m25p->command field Boris Brezillon
@ 2018-06-01 10:03 ` Boris Brezillon
  2018-06-18  9:41   ` Marek Vasut
  2018-06-18  9:04 ` [PATCH 1/2] mtd: m25p80: Remove unneeded m25p->command field Boris Brezillon
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Boris Brezillon @ 2018-06-01 10:03 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, linux-mtd

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>
---
 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)
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] mtd: m25p80: Remove unneeded m25p->command field
  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:04 ` Boris Brezillon
  2018-06-18  9:40 ` Marek Vasut
  2018-06-19  5:45 ` Boris Brezillon
  3 siblings, 0 replies; 6+ messages in thread
From: Boris Brezillon @ 2018-06-18  9:04 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, linux-mtd

Hi Marek,

Can you add your Acked-by or Reviewed-by if you're okay with these
changes?

Thanks,

Boris

On Fri,  1 Jun 2018 12:03:24 +0200
Boris Brezillon <boris.brezillon@bootlin.com> wrote:

> The ->command field is no longer used, remove it.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---
>  drivers/mtd/devices/m25p80.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 3dc022d3b53e..73dd74330227 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -28,11 +28,9 @@
>  #include <linux/spi/flash.h>
>  #include <linux/mtd/spi-nor.h>
>  
> -#define	MAX_CMD_SIZE		6
>  struct m25p {
>  	struct spi_mem		*spimem;
>  	struct spi_nor		spi_nor;
> -	u8			command[MAX_CMD_SIZE];
>  };
>  
>  static int m25p80_read_reg(struct spi_nor *nor, u8 code, u8 *val, int len)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] mtd: m25p80: Remove unneeded m25p->command field
  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: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
  3 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2018-06-18  9:40 UTC (permalink / raw)
  To: Boris Brezillon, David Woodhouse, Brian Norris,
	Richard Weinberger, linux-mtd

On 06/01/2018 12:03 PM, Boris Brezillon wrote:
> The ->command field is no longer used, remove it.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>

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

> ---
>  drivers/mtd/devices/m25p80.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 3dc022d3b53e..73dd74330227 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -28,11 +28,9 @@
>  #include <linux/spi/flash.h>
>  #include <linux/mtd/spi-nor.h>
>  
> -#define	MAX_CMD_SIZE		6
>  struct m25p {
>  	struct spi_mem		*spimem;
>  	struct spi_nor		spi_nor;
> -	u8			command[MAX_CMD_SIZE];
>  };
>  
>  static int m25p80_read_reg(struct spi_nor *nor, u8 code, u8 *val, int len)
> 


-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] mtd: m25p80: Use SPI_MEM_OP_NO_DUMMY instead of SPI_MEM_OP_DUMMY(0, x)
  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
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2018-06-18  9:41 UTC (permalink / raw)
  To: Boris Brezillon, David Woodhouse, Brian Norris,
	Richard Weinberger, linux-mtd

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] mtd: m25p80: Remove unneeded m25p->command field
  2018-06-01 10:03 [PATCH 1/2] mtd: m25p80: Remove unneeded m25p->command field Boris Brezillon
                   ` (2 preceding siblings ...)
  2018-06-18  9:40 ` Marek Vasut
@ 2018-06-19  5:45 ` Boris Brezillon
  3 siblings, 0 replies; 6+ messages in thread
From: Boris Brezillon @ 2018-06-19  5:45 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, linux-mtd

On Fri,  1 Jun 2018 12:03:24 +0200
Boris Brezillon <boris.brezillon@bootlin.com> wrote:

> The ->command field is no longer used, remove it.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>

Applied both patches to spi-nor/next.

> ---
>  drivers/mtd/devices/m25p80.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 3dc022d3b53e..73dd74330227 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -28,11 +28,9 @@
>  #include <linux/spi/flash.h>
>  #include <linux/mtd/spi-nor.h>
>  
> -#define	MAX_CMD_SIZE		6
>  struct m25p {
>  	struct spi_mem		*spimem;
>  	struct spi_nor		spi_nor;
> -	u8			command[MAX_CMD_SIZE];
>  };
>  
>  static int m25p80_read_reg(struct spi_nor *nor, u8 code, u8 *val, int len)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-19  5:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.