1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 22:52:34 +02:00

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 <mr.nuke.me@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:
Alexandru Gagniuc 2014-03-19 17:17:00 +00:00 committed by Stefan Tauner
parent bf8ea49c0c
commit d29806ffde

View File

@ -68,7 +68,7 @@ int linux_spi_init(void)
p = extract_programmer_param("spispeed"); p = extract_programmer_param("spispeed");
if (p && strlen(p)) { if (p && strlen(p)) {
speed = (uint32_t)strtoul(p, &endp, 10) * 1024; speed = (uint32_t)strtoul(p, &endp, 10) * 1000;
if (p == endp) { if (p == endp) {
msg_perr("%s: invalid clock: %s kHz\n", __func__, p); msg_perr("%s: invalid clock: %s kHz\n", __func__, p);
free(p); free(p);