summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/spi-nor
diff options
context:
space:
mode:
authorTudor Ambarus <tudor.ambarus@microchip.com>2019-08-28 12:35:17 +0200
committerTudor Ambarus <tudor.ambarus@microchip.com>2019-08-29 12:39:56 +0200
commit3a960339e08e168c03f0587b788f05fadf4e396d (patch)
tree9ef3fec3b69662b2f342dd62cd9436b556908b16 /drivers/mtd/spi-nor
parentmtd: spi-nor: enable the debugfs for the partname and partid (diff)
downloadlinux-3a960339e08e168c03f0587b788f05fadf4e396d.tar.xz
linux-3a960339e08e168c03f0587b788f05fadf4e396d.zip
mtd: spi-nor: remove superfluous pass of nor->info->sector_size
We already pass a pointer to nor, we can obtain the sector_size by dereferencing it. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Diffstat (limited to 'drivers/mtd/spi-nor')
-rw-r--r--drivers/mtd/spi-nor/spi-nor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 6a2fff0598af..c6ebfbe25a73 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -4257,11 +4257,12 @@ spi_nor_select_uniform_erase(struct spi_nor_erase_map *map,
return erase;
}
-static int spi_nor_select_erase(struct spi_nor *nor, u32 wanted_size)
+static int spi_nor_select_erase(struct spi_nor *nor)
{
struct spi_nor_erase_map *map = &nor->params.erase_map;
const struct spi_nor_erase_type *erase = NULL;
struct mtd_info *mtd = &nor->mtd;
+ u32 wanted_size = nor->info->sector_size;
int i;
/*
@@ -4355,7 +4356,7 @@ static int spi_nor_default_setup(struct spi_nor *nor,
}
/* Select the Sector Erase command. */
- err = spi_nor_select_erase(nor, nor->info->sector_size);
+ err = spi_nor_select_erase(nor);
if (err) {
dev_err(nor->dev,
"can't select erase settings supported by both the SPI controller and memory.\n");