Skip to content

Commit 8e4bdda

Browse files
author
Joel Slebodnick
committed
mtd: spi-nor: core: Use auto-detection only once
JIRA: https://issues.redhat.com/browse/RHEL-40636 commit bffabd1 Author: Tudor Ambarus <tudor.ambarus@microchip.com> Date: Wed Apr 20 13:34:19 2022 +0300 mtd: spi-nor: core: Use auto-detection only once In case spi_nor_match_name() returned NULL, the auto detection was issued twice. There's no reason to try to detect the same chip twice, do the auto detection only once. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Michael Walle <michael@walle.cc> Link: https://lore.kernel.org/r/20220420103427.47867-4-tudor.ambarus@microchip.com Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
1 parent 704ec89 commit 8e4bdda

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/mtd/spi-nor/core.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3038,9 +3038,7 @@ static const struct flash_info *spi_nor_get_flash_info(struct spi_nor *nor,
30383038
info = spi_nor_match_name(nor, name);
30393039
/* Try to auto-detect if chip name wasn't specified or not found */
30403040
if (!info)
3041-
info = spi_nor_read_id(nor);
3042-
if (IS_ERR_OR_NULL(info))
3043-
return ERR_PTR(-ENOENT);
3041+
return spi_nor_read_id(nor);
30443042

30453043
/*
30463044
* If caller has specified name of flash model that can normally be

0 commit comments

Comments
 (0)