From d29806ffdefe2334de7bb5782ed08ade6d9712af Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Wed, 19 Mar 2014 17:17:00 +0000 Subject: [PATCH] linux_spi: Fix conversion from kHz to Hz A kilohertz is exactly 1000 hertz, not 1024 hertz. Corresponding to flashrom svn r1768. Signed-off-by: Alexandru Gagniuc Acked-by: Stefan Tauner --- linux_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux_spi.c b/linux_spi.c index d12fceb2e..135af9f7e 100644 --- a/linux_spi.c +++ b/linux_spi.c @@ -68,7 +68,7 @@ int linux_spi_init(void) p = extract_programmer_param("spispeed"); if (p && strlen(p)) { - speed = (uint32_t)strtoul(p, &endp, 10) * 1024; + speed = (uint32_t)strtoul(p, &endp, 10) * 1000; if (p == endp) { msg_perr("%s: invalid clock: %s kHz\n", __func__, p); free(p);