summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/spi/sf_probe.c4
-rw-r--r--drivers/mtd/spi/spi_flash.c2
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
index daa1d5b249..7b296378d2 100644
--- a/drivers/mtd/spi/sf_probe.c
+++ b/drivers/mtd/spi/sf_probe.c
@@ -42,10 +42,8 @@ static int spi_flash_probe_slave(struct spi_flash *flash)
}
ret = spi_flash_scan(flash);
- if (ret) {
- ret = -EINVAL;
+ if (ret)
goto err_read_id;
- }
#ifdef CONFIG_SPI_FLASH_MTD
ret = spi_flash_mtd_register(flash);
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 3c365d5e9a..2ae2e3c8c9 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -989,7 +989,7 @@ int spi_flash_scan(struct spi_flash *flash)
ret = spi_flash_cmd(spi, CMD_READ_ID, idcode, sizeof(idcode));
if (ret) {
printf("SF: Failed to get idcodes\n");
- return -EINVAL;
+ return ret;
}
#ifdef DEBUG