[U-Boot] [PATCH] cmd_sf: rename "speed" to "hz"

Mike Frysinger vapier at gentoo.org
Thu Dec 11 23:28:08 CET 2008


The term "hz" is used everywhere else when talking about the frequency of
the SPI bus, so have the sf command use it as well to stay consistent.  It
even presents itself as "hz" when showing user help.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 common/cmd_sf.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index 8c0a751..902e51d 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -8,8 +8,8 @@
 
 #include <asm/io.h>
 
-#ifndef CONFIG_SF_DEFAULT_SPEED
-# define CONFIG_SF_DEFAULT_SPEED	1000000
+#ifndef CONFIG_SF_DEFAULT_HZ
+# define CONFIG_SF_DEFAULT_HZ	1000000
 #endif
 #ifndef CONFIG_SF_DEFAULT_MODE
 # define CONFIG_SF_DEFAULT_MODE		SPI_MODE_3
@@ -21,7 +21,7 @@ static int do_spi_flash_probe(int argc, char *argv[])
 {
 	unsigned int bus = 0;
 	unsigned int cs;
-	unsigned int speed = CONFIG_SF_DEFAULT_SPEED;
+	unsigned int hz = CONFIG_SF_DEFAULT_HZ;
 	unsigned int mode = CONFIG_SF_DEFAULT_MODE;
 	char *endp;
 	struct spi_flash *new;
@@ -43,7 +43,7 @@ static int do_spi_flash_probe(int argc, char *argv[])
 	}
 
 	if (argc >= 3) {
-		speed = simple_strtoul(argv[2], &endp, 0);
+		hz = simple_strtoul(argv[2], &endp, 0);
 		if (*argv[2] == 0 || *endp != 0)
 			goto usage;
 	}
@@ -53,7 +53,7 @@ static int do_spi_flash_probe(int argc, char *argv[])
 			goto usage;
 	}
 
-	new = spi_flash_probe(bus, cs, speed, mode);
+	new = spi_flash_probe(bus, cs, hz, mode);
 	if (!new) {
 		printf("Failed to initialize SPI flash at %u:%u\n", bus, cs);
 		return 1;
-- 
1.6.0.4



More information about the U-Boot mailing list