mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-01 06:01:16 +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:
@ -154,7 +154,8 @@ int wbsio_spi_send_command(unsigned int writecnt, unsigned int readcnt,
|
||||
if (!mode) {
|
||||
fprintf(stderr, "%s: unsupported command type wr=%d rd=%d\n",
|
||||
__func__, writecnt, readcnt);
|
||||
return 1;
|
||||
/* Command type refers to the number of bytes read/written. */
|
||||
return SPI_INVALID_LENGTH;
|
||||
}
|
||||
|
||||
OUTB(writearr[0], wbsio_spibase);
|
||||
|
Reference in New Issue
Block a user