Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9ec3900 authored by Brian Norris's avatar Brian Norris
Browse files

mtd: spi-nor: assign mtd->priv in spi_nor_scan()



Layering suggests that the SPI NOR layer (not the hardware driver)
should be initializing the MTD layer.

Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Tested-by: default avatarJoachim Eastwood <manabian@gmail.com>
parent 0f12a27b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -205,7 +205,6 @@ static int m25p_probe(struct spi_device *spi)
	nor->priv = flash;

	spi_set_drvdata(spi, flash);
	flash->mtd.priv = nor;
	flash->spi = spi;

	if (spi->mode & SPI_RX_QUAD)
+0 −1
Original line number Diff line number Diff line
@@ -1018,7 +1018,6 @@ static int fsl_qspi_probe(struct platform_device *pdev)
		nor->mtd = mtd;
		nor->dev = dev;
		nor->priv = q;
		mtd->priv = nor;

		/* fill the hooks */
		nor->read_reg = fsl_qspi_read_reg;
+0 −1
Original line number Diff line number Diff line
@@ -331,7 +331,6 @@ static int nxp_spifi_setup_flash(struct nxp_spifi *spifi,

	writel(ctrl, spifi->io_base + SPIFI_CTRL);

	spifi->mtd.priv  = &spifi->nor;
	spifi->nor.mtd   = &spifi->mtd;
	spifi->nor.dev   = spifi->dev;
	spifi->nor.priv  = spifi;
+1 −0
Original line number Diff line number Diff line
@@ -1061,6 +1061,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)

	if (!mtd->name)
		mtd->name = dev_name(dev);
	mtd->priv = nor;
	mtd->type = MTD_NORFLASH;
	mtd->writesize = 1;
	mtd->flags = MTD_CAP_NORFLASH;