diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2021-12-07 16:02:42 +0200 |
---|---|---|
committer | Tudor Ambarus <tudor.ambarus@microchip.com> | 2021-12-07 17:05:10 +0200 |
commit | eb726c322020b95bfc1fbf0e83d0fd41c2500e96 (patch) | |
tree | e166c359a1382ec77386f0cdce8a00d782681800 /drivers/mtd/spi-nor/xilinx.c | |
parent | f656b419d41aabafb6b526abc3988dfbf2e5c1ba (diff) | |
download | linux-eb726c322020b95bfc1fbf0e83d0fd41c2500e96.tar.gz |
mtd: spi-nor: core: Don't use mtd_info in the NOR's probe sequence of calls
Use NOR parameters in the probe's sequence of calls, thus
nor->params->size instead of nor->mtd.size and let the mtd_info
fields be used by the mtd calls (mtd->_erase, mtd->_read, mtd->_write).
mtd_info fields should not be used during probe because we haven't
registered mtd yet. It's safe to drop xilinx's setting of nor->mtd.size,
now that we use nor->params->size in spi_nor_set_addr_width().
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Link: https://lore.kernel.org/r/20211207140254.87681-3-tudor.ambarus@microchip.com
Diffstat (limited to 'drivers/mtd/spi-nor/xilinx.c')
-rw-r--r-- | drivers/mtd/spi-nor/xilinx.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/mtd/spi-nor/xilinx.c b/drivers/mtd/spi-nor/xilinx.c index 03d3b006a039..580562bc1e45 100644 --- a/drivers/mtd/spi-nor/xilinx.c +++ b/drivers/mtd/spi-nor/xilinx.c @@ -70,7 +70,6 @@ static int xilinx_nor_setup(struct spi_nor *nor, nor->params->page_size = page_size; nor->mtd.writebufsize = page_size; nor->params->size = 8 * page_size * nor->info->n_sectors; - nor->mtd.size = nor->params->size; nor->mtd.erasesize = 8 * page_size; } else { /* Flash in Default addressing mode */ |