mtd: spi-nor: core: Don't use mtd_info in the NOR's probe sequence of calls
authorTudor Ambarus <tudor.ambarus@microchip.com>
Tue, 7 Dec 2021 14:02:42 +0000 (16:02 +0200)
committerTudor Ambarus <tudor.ambarus@microchip.com>
Tue, 7 Dec 2021 15:05:10 +0000 (17:05 +0200)
commiteb726c322020b95bfc1fbf0e83d0fd41c2500e96
treee166c359a1382ec77386f0cdce8a00d782681800
parentf656b419d41aabafb6b526abc3988dfbf2e5c1ba
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
drivers/mtd/spi-nor/core.c
drivers/mtd/spi-nor/xilinx.c