mirror of https://gitee.com/openkylin/linux.git
mtd: devices: m25p80: Use spi_mem_set_drvdata() instead of spi_set_drvdata()
SPI mem drivers should use spi_mem_set_drvdata() not spi_set_drvdata()
to store their private data. Using spi_set_drvdata() will mess the
spi -> spi-mem link up and cause a kernel panic at shutdown or
device removal time.
Fixes: 4120f8d158
("mtd: spi-nor: Use the spi_mem_xx() API")
Reported-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Marek Vasut <marek.vasut+renesas@gmail.com> on R8A7791 Porter
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
d073bfa56b
commit
1e07392e7b
|
@ -182,7 +182,7 @@ static int m25p_probe(struct spi_mem *spimem)
|
||||||
spi_nor_set_flash_node(nor, spi->dev.of_node);
|
spi_nor_set_flash_node(nor, spi->dev.of_node);
|
||||||
nor->priv = flash;
|
nor->priv = flash;
|
||||||
|
|
||||||
spi_set_drvdata(spi, flash);
|
spi_mem_set_drvdata(spimem, flash);
|
||||||
flash->spimem = spimem;
|
flash->spimem = spimem;
|
||||||
|
|
||||||
if (spi->mode & SPI_RX_QUAD) {
|
if (spi->mode & SPI_RX_QUAD) {
|
||||||
|
|
Loading…
Reference in New Issue