diff options
author | Fabien Parent <fparent@baylibre.com> | 2016-12-05 19:09:10 +0100 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2016-12-15 16:57:28 +0100 |
commit | 304decdd31d54ae274f785fb086f3f6ae30a8711 (patch) | |
tree | ed9e477cd133459490c0dbd5fab4582636961cb0 /drivers/mtd | |
parent | 6d72810c6640e13b4c1e25f6c26ac8c304d5b54e (diff) |
mtd: spi: don't return -1 when scan succeed
In spi_flash_scan, 'ret' is initialled to -1, but 'ret' is not always
used to store a return value, in that case, even when the function
succeed, an error (-1) will be returned.
Lets just return 0 if we hit the end of the function.
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/spi/spi_flash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 94c0b0063d..41fc0a6a24 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -1000,7 +1000,7 @@ int spi_flash_scan(struct spi_flash *flash) { struct spi_slave *spi = flash->spi; const struct spi_flash_info *info = NULL; - int ret = -1; + int ret; info = spi_flash_read_id(flash); if (IS_ERR_OR_NULL(info)) @@ -1166,5 +1166,5 @@ int spi_flash_scan(struct spi_flash *flash) } #endif - return ret; + return 0; } |