diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2021-10-29 20:26:10 +0300 |
---|---|---|
committer | Tudor Ambarus <tudor.ambarus@microchip.com> | 2021-11-17 14:36:01 +0200 |
commit | 7158c86e560789a4a07fe161cc284f8058d52ccc (patch) | |
tree | 64adc7d3dcf807ae1d1b95e1e32d8496288b98d2 /drivers/mtd/spi-nor/core.c | |
parent | a360ae43217c45fb7ca37603ffb6c06aad2b3929 (diff) | |
download | linux-7158c86e560789a4a07fe161cc284f8058d52ccc.tar.bz2 |
mtd: spi-nor: core: Use container_of to get the pointer to struct spi_nor
"struct mtd_info mtd" is member of "struct spi_nor", there's no need
to use "mtd->priv". Get the pointer to the containing struct spi_nor
by using container_of. While here, make the function inline and
get rid of the __maybe_unused.
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/20211029172633.886453-3-tudor.ambarus@microchip.com
Diffstat (limited to 'drivers/mtd/spi-nor/core.c')
-rw-r--r-- | drivers/mtd/spi-nor/core.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index cc08bd707378..277d1fde84c8 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3134,7 +3134,6 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, if (!mtd->name) mtd->name = dev_name(dev); - mtd->priv = nor; mtd->type = MTD_NORFLASH; mtd->writesize = nor->params->writesize; mtd->flags = MTD_CAP_NORFLASH; |