Attention is currently required from: ZhiYuanNJ.
2 comments:
File ch347_spi.c:
Patch Set #5, Line 290: int index = 0;
I just noticed this when testing your patch. If the spispeed isn't set, `divisor` defaults to 1 (30 MHz), but the message in line 370 says 60M because `index` defaults to 0:
```
flashrom 1.4.0-devel (git:v1.2-1460-g59c77b71) on Linux 6.9.4-arch1-1 (x86_64)
flashrom is free software, get the source code at https://flashrom.org
Invalid SPI speed, using 30MHz clock spi.
CH347 SPI clock set to 60M.
```
You could change index to default to 1, but then there would be two variables that need the proper default set. Perhaps rework it so that it only uses `index` (dropping `divisor`) and then determines the value to pass to `ch347_spi_init()` based on that?
Patch Set #5, Line 370: msg_pinfo("CH347 SPI clock set to %s.\n", spispeeds[index].name);
If the spispeed parameter is invalid, `index` is 8 here, so this prints out `CH347 SPI clock set to (null)`, though `divisor` will still be the default 1 so flashrom will internally proceed with 30 MHz.
To view, visit change 82776. To unsubscribe, or for help writing mail filters, visit settings.