]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mtd: spi-nor: remove superfluous pass of nor->info->sector_size
authorTudor Ambarus <tudor.ambarus@microchip.com>
Wed, 28 Aug 2019 10:35:17 +0000 (10:35 +0000)
committerTudor Ambarus <tudor.ambarus@microchip.com>
Thu, 29 Aug 2019 10:39:56 +0000 (13:39 +0300)
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>
drivers/mtd/spi-nor/spi-nor.c

index 6a2fff0598af5725b9acf387f2accb00fcfc23e2..c6ebfbe25a73c3c4c13b321fd026e83eff5030d9 100644 (file)
@@ -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");