]> Git Repo - u-boot.git/commitdiff
cmd: sf Drop reassignment of new into flash
authorJagan Teki <[email protected]>
Wed, 13 May 2020 10:58:01 +0000 (16:28 +0530)
committerJagan Teki <[email protected]>
Mon, 1 Jun 2020 12:25:24 +0000 (17:55 +0530)
The new pointer points to flash found and that would
assign it to global 'flash' pointer for further flash
operations and also keep track of old flash pointer.

This would happen if the probe is successful or even
failed, but current code assigning new into flash before
and after checking the new.

So, drop the assignment after new checks so flash always
latest new pointer even if probe failed or succeed.

Cc: Simon Glass <[email protected]>
Cc: Vignesh R <[email protected]>
Signed-off-by: Jagan Teki <[email protected]>
cmd/sf.c

index 727837d9cd1f7c99d1cb5ed7fbc90d7ca2bdc8fd..d18f6a888ce48c6ec142e7c658a828668d3c079e 100644 (file)
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -145,13 +145,10 @@ static int do_spi_flash_probe(int argc, char *const argv[])
 
        new = spi_flash_probe(bus, cs, speed, mode);
        flash = new;
-
        if (!new) {
                printf("Failed to initialize SPI flash at %u:%u\n", bus, cs);
                return 1;
        }
-
-       flash = new;
 #endif
 
        return 0;
This page took 0.034728 seconds and 4 git commands to generate.