]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_flash.c
dm: Adjust lists_bind_fdt() to return the bound device
[karo-tx-uboot.git] / common / cmd_flash.c
index 0e9b2e3c741e2b534904acf06944b68a044f77c9..85d18bb2c53a4787af348147fe2dd1a4b7242c42 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -289,7 +273,7 @@ flash_fill_sect_ranges (ulong addr_first, ulong addr_last,
 }
 #endif /* CONFIG_SYS_NO_FLASH */
 
-int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_flinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 #ifndef CONFIG_SYS_NO_FLASH
        ulong bank;
@@ -321,7 +305,7 @@ int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        return 0;
 }
 
-int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_flerase(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 #ifndef CONFIG_SYS_NO_FLASH
        flash_info_t *info = NULL;
@@ -443,7 +427,8 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
                                rcode = flash_erase (info, s_first[bank], s_last[bank]);
                        }
                }
-               printf ("Erased %d sectors\n", erased);
+               if (rcode == 0)
+                       printf("Erased %d sectors\n", erased);
        } else if (rcode == 0) {
                puts ("Error: start and/or end address"
                        " not on sector boundary\n");
@@ -453,7 +438,7 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
 }
 #endif /* CONFIG_SYS_NO_FLASH */
 
-int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_protect(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        int rcode = 0;
 #ifndef CONFIG_SYS_NO_FLASH