X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=cmd%2Fsf.c;h=e993b3e5adcda20060057472a15b0085c1f11442;hb=6a82579bdd40b4befb6ab4728a7d5fbf246f9705;hp=84bb0575f233892e22f8cb9162cbde2cc5a22f8e;hpb=e8f80a5a58c9b506453cc0780687e8ed457d30a6;p=oweals%2Fu-boot.git diff --git a/cmd/sf.c b/cmd/sf.c index 84bb0575f2..e993b3e5ad 100644 --- a/cmd/sf.c +++ b/cmd/sf.c @@ -18,6 +18,8 @@ #include #include +#include "legacy-mtd-utils.h" + static struct spi_flash *flash; /* @@ -81,14 +83,13 @@ static int do_spi_flash_probe(int argc, char * const argv[]) { unsigned int bus = CONFIG_SF_DEFAULT_BUS; unsigned int cs = CONFIG_SF_DEFAULT_CS; + /* In DM mode, defaults speed and mode will be taken from DT */ unsigned int speed = CONFIG_SF_DEFAULT_SPEED; unsigned int mode = CONFIG_SF_DEFAULT_MODE; char *endp; #ifdef CONFIG_DM_SPI_FLASH struct udevice *new, *bus_dev; int ret; - /* In DM mode defaults will be taken from DT */ - speed = 0, mode = 0; #else struct spi_flash *new; #endif @@ -413,7 +414,7 @@ static void show_time(struct test_info *test, int stage) do_div(speed, test->time_ms[stage] * 1024); bps = speed * 8; - printf("%d %s: %d ticks, %d KiB/s %d.%03d Mbps\n", stage, + printf("%d %s: %u ticks, %d KiB/s %d.%03d Mbps\n", stage, stage_name[stage], test->time_ms[stage], (int)speed, bps / 1000, bps % 1000); }