]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: spi-nor: fill-in mtd->dev member
authorMarek Behún <marek.behun@nic.cz>
Wed, 26 May 2021 12:08:21 +0000 (14:08 +0200)
committerJagan Teki <jagan@amarulasolutions.com>
Thu, 24 Jun 2021 06:23:50 +0000 (11:53 +0530)
Fill in mtd->dev member with nor->dev.

This can be used by MTD OF partition parser.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Cc: Priyanka Jain <priyanka.jain@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Heiko Schocher <hs@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
drivers/mtd/spi/sf_mtd.c
drivers/mtd/spi/spi-nor-core.c
drivers/mtd/spi/spi-nor-tiny.c

index 94854fbfc42b989f1d9a2f8a97eb218bcdd40a6f..04de8680809c055206b14bb34c736ec5cfde20a0 100644 (file)
@@ -125,6 +125,7 @@ int spi_flash_mtd_register(struct spi_flash *flash)
 
        sf_mtd_info.size = flash->size;
        sf_mtd_info.priv = flash;
+       sf_mtd_info.dev = flash->dev;
 
        /* Only uniform flash devices for now */
        sf_mtd_info.numeraseregions = 0;
index a6625535a703e639fa3f11b4593f7ea4d4590ae6..6af9c675a4f4a35208c1b0d9af13df390e41a2a6 100644 (file)
@@ -2535,6 +2535,7 @@ int spi_nor_scan(struct spi_nor *nor)
 
        if (!mtd->name)
                mtd->name = info->name;
+       mtd->dev = nor->dev;
        mtd->priv = nor;
        mtd->type = MTD_NORFLASH;
        mtd->writesize = 1;
index 1d5861d55cd83323133edef3ad4764903807d6a5..b0aa97d3244640a47dc2ad2fad6e4d637ecd7c0c 100644 (file)
@@ -751,6 +751,7 @@ int spi_nor_scan(struct spi_nor *nor)
                return ret;
 
        mtd->name = "spi-flash";
+       mtd->dev = nor->dev;
        mtd->priv = nor;
        mtd->type = MTD_NORFLASH;
        mtd->writesize = 1;