summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/spi/sf_probe.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-02-24 09:14:56 -0700
committerSimon Glass <sjg@chromium.org>2016-02-26 08:53:10 -0700
commit0badb23d110c886cf25550325f36ce1eba1eb5e2 (patch)
tree26e8ea35370c5d17180ddb96509ea1e97b8771d8 /drivers/mtd/spi/sf_probe.c
parentffe276d27a538ca410d697126c562a1ce0ac8bbc (diff)
downloadtalos-obmc-uboot-0badb23d110c886cf25550325f36ce1eba1eb5e2.tar.gz
talos-obmc-uboot-0badb23d110c886cf25550325f36ce1eba1eb5e2.zip
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: Simon Glass <sjg@chromium.org> Fixes: 1e90d9fd (sf: Move read_id code to sf_ops) Reviewed-by: Jagan Teki <jteki@openedev.com> Tested-by: Jagan Teki <jteki@openedev.com>
Diffstat (limited to 'drivers/mtd/spi/sf_probe.c')
-rw-r--r--drivers/mtd/spi/sf_probe.c4
1 files changed, 1 insertions, 3 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);
OpenPOWER on IntegriCloud