Re: [PATCH v4 6/7] mtd: spi-nor: Use the spi_mem_xx() API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Cyrille,

On Wed, 23 May 2018 17:44:32 +0200
Cyrille Pitchen <cyrille.pitchen@xxxxxxxxxxxxx> wrote:

> > +					  SPI_MEM_OP_DATA_OUT(len, buf, 1));
> >  
> > -	return spi_write(spi, flash->command, len + 1);
> > +	return spi_mem_exec_op(flash->spimem, &op);
> >  }
> >  
> >  static ssize_t m25p80_write(struct spi_nor *nor, loff_t to, size_t len,
> >  			    const u_char *buf)
> >  {
> >  	struct m25p *flash = nor->priv;
> > -	struct spi_device *spi = flash->spi;
> > -	unsigned int inst_nbits, addr_nbits, data_nbits, data_idx;
> > -	struct spi_transfer t[3] = {};
> > -	struct spi_message m;
> > -	int cmd_sz = m25p_cmdsz(nor);
> > -	ssize_t ret;
> > +	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),  
> 
> Why do you use SPI_MEM_OP_DUMMY(0, 1) here instead of SPI_MEM_OP_NO_DUMMY() ?

I guess I just copied the definition from m25p80_read() and modified
the definition without noticing this one could be replaced by
SPI_MEM_OP_NO_DUMMY. Not a big deal though, since SPI_MEM_OP_DUMMY(0,
1) still means "no dummy cycles".

Do you plan to send a patch to change that, or should I?

Regards,

Boris
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux