]> git.sur5r.net Git - u-boot/blobdiff - cmd/sf.c
sunxi: R40: add gigabit ethernet clocks
[u-boot] / cmd / sf.c
index f971eec781cc88978f181a9a24ec9d37dff6b11d..84bb0575f233892e22f8cb9162cbde2cc5a22f8e 100644 (file)
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Command for accessing SPI flash.
  *
  * Copyright (C) 2008 Atmel Corporation
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -287,7 +286,7 @@ static int do_spi_flash_read_write(int argc, char * const argv[])
        }
 
        buf = map_physmem(addr, len, MAP_WRBACK);
-       if (!buf) {
+       if (!buf && addr) {
                puts("Failed to map physical memory\n");
                return 1;
        }