Commit 560ee3b
committed
u-boot: v2026.04: helios64: preserve SPI I/O error in read_otp_data
spi_write_then_read() returned value was only used to set has_been_read,
then header/CRC checks ran against whatever ended up in the otp struct.
On a real SPI I/O failure, the struct could contain partial garbage,
header/CRC would fail, and the caller got a generic -1 — losing the
original errno and conflating I/O errors with invalid OTP data.
Handle the I/O error path explicitly:
- On ret != 0: log, keep has_been_read = 0 (so the next call can retry),
and return the original ret.
- On ret == 0: set has_been_read = 1 and proceed to header/CRC validation
as before.
Addresses a CodeRabbit review comment on PR armbian#9675.1 parent 611fff6 commit 560ee3b
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
181 | 187 | | |
182 | 188 | | |
183 | 189 | | |
| |||
0 commit comments