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:
@ -170,7 +170,7 @@ int it8716f_spi_send_command(unsigned int writecnt, unsigned int readcnt,
|
||||
if (readcnt > 3) {
|
||||
printf("%s called with unsupported readcnt %i.\n",
|
||||
__FUNCTION__, readcnt);
|
||||
return 1;
|
||||
return SPI_INVALID_LENGTH;
|
||||
}
|
||||
switch (writecnt) {
|
||||
case 1:
|
||||
@ -200,7 +200,7 @@ int it8716f_spi_send_command(unsigned int writecnt, unsigned int readcnt,
|
||||
default:
|
||||
printf("%s called with unsupported writecnt %i.\n",
|
||||
__FUNCTION__, writecnt);
|
||||
return 1;
|
||||
return SPI_INVALID_LENGTH;
|
||||
}
|
||||
/*
|
||||
* Start IO, 33 or 16 MHz, readcnt input bytes, writecnt output bytes.
|
||||
|
Reference in New Issue
Block a user