提交 0badb23d 编写于 作者: S Simon Glass

spi: Correct two error return values

When an error number is provided we should use it, not change it. This fixes
the SPI and SPI flash tests.

One of these is long-standing. The other seems to have been introduced by
commit 1e90d9fd (sf: Move read_id code to sf_ops).
Signed-off-by: NSimon Glass <sjg@chromium.org>
Fixes: 1e90d9fd (sf: Move read_id code to sf_ops)
Reviewed-by: NJagan Teki <jteki@openedev.com>
Tested-by: NJagan Teki <jteki@openedev.com>
上级 ffe276d2
......@@ -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);
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册