Skip to content

Commit d322e40

Browse files
neosys007miquelraynal
authored andcommitted
mtd: mchp23k256: use SPI match data for chip caps
The driver stores chip capacity information in both the OF match table and the SPI id table. Probe currently uses of_device_get_match_data(), so a non-OF SPI modalias match falls back to mchp23k256_caps even when the SPI id table selected a different part. Use spi_get_device_match_data() so SPI id-table driver_data is consumed when OF match data is absent. This keeps the existing default fallback while avoiding the wrong MTD geometry for id-table-only matches. Fixes: 4379075 ("mtd: mchp23k256: Add support for mchp23lcv1024") Cc: stable@vger.kernel.org Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
1 parent 17a8ce8 commit d322e40

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mtd/devices/mchp23k256.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static int mchp23k256_probe(struct spi_device *spi)
188188

189189
data = dev_get_platdata(&spi->dev);
190190

191-
flash->caps = of_device_get_match_data(&spi->dev);
191+
flash->caps = spi_get_device_match_data(spi);
192192
if (!flash->caps)
193193
flash->caps = &mchp23k256_caps;
194194

0 commit comments

Comments
 (0)