Re: [PATCH v2 5/7] mtd: devices: m25p80: Use the spi-mem dirmap API

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

 



On Wed, 31 Oct 2018 10:28:04 +0000
Yogesh Narayan Gaur <yogeshnarayan.gaur@xxxxxxx> wrote:


> > +static int m25p_create_read_dirmap(struct m25p *flash) {
> > +	struct spi_nor *nor = &flash->spi_nor;
> > +	struct spi_mem_dirmap_info info = {
> > +		.op_tmpl = SPI_MEM_OP(SPI_MEM_OP_CMD(nor-  
> > >read_opcode, 1),  
> > +				      SPI_MEM_OP_ADDR(nor->addr_width, 0, 1),
> > +				      SPI_MEM_OP_DUMMY(nor->read_dummy,
> > 1),
> > +				      SPI_MEM_OP_DATA_IN(0, NULL, 1)),
> > +		.offset = 0,
> > +		.length = flash->spi_nor.mtd.size,  
> 
> I want to understand the sequence of calling up of this routine from drivers/mtd/spi-nor/spi-nor.c file.
> Because till point of JedecID read and SFDP command read mtd.size is not being populated and having value as 0. This would make length as 0.

When the dirmap is created mtd->size has been initialized already. But
you're right, nor->read() might be called before the read dirmap has
been created (SFDP read), which will lead to a NULL pointer exception.

> 
> Did these read follow different path?

Nope.




[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