]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: spi: don't return -1 when scan succeed
authorFabien Parent <fparent@baylibre.com>
Mon, 5 Dec 2016 18:09:10 +0000 (19:09 +0100)
committerJagan Teki <jagan@amarulasolutions.com>
Thu, 15 Dec 2016 15:57:28 +0000 (16:57 +0100)
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>
drivers/mtd/spi/spi_flash.c

index 94c0b0063d1a833b30557fcb0f35ed53d9496f66..41fc0a6a2446da0fa96de47efe93939d4dc0aed7 100644 (file)
@@ -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;
 }