mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 06:23:18 +02:00
Use a distinct return code for SPI commands with unsupported/invalid length
Some drivers support only a few combinations of read/write length and return error otherwise. Having a distinct return code for this error means we can handle it in upper layers. Corresponding to flashrom svn r653. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de>
This commit is contained in:
10
sb600spi.c
10
sb600spi.c
@ -114,14 +114,14 @@ int sb600_spi_send_command(unsigned int writecnt, unsigned int readcnt,
|
||||
|
||||
if (readcnt > 8) {
|
||||
printf("%s, SB600 SPI controller can not receive %d bytes, "
|
||||
"which is limited with 8 bytes\n", __func__, readcnt);
|
||||
return 1;
|
||||
"it is limited to 8 bytes\n", __func__, readcnt);
|
||||
return SPI_INVALID_LENGTH;
|
||||
}
|
||||
|
||||
if (writecnt > 8) {
|
||||
printf("%s, SB600 SPI controller can not sent %d bytes, "
|
||||
"which is limited with 8 bytes\n", __func__, writecnt);
|
||||
return 1;
|
||||
printf("%s, SB600 SPI controller can not send %d bytes, "
|
||||
"it is limited to 8 bytes\n", __func__, writecnt);
|
||||
return SPI_INVALID_LENGTH;
|
||||
}
|
||||
|
||||
mmio_writeb(cmd, sb600_spibar + 0);
|
||||
|
Reference in New Issue
Block a user