summaryrefslogtreecommitdiff
path: root/sb600spi.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-07-14 10:26:56 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-07-14 10:26:56 +0000
commitedee3683b1b451089c6f160bb3540e65354a0e24 (patch)
treec286d89dadacecee2e68b84ce5606467e9ae33e8 /sb600spi.c
parent3f6c540ae63303e5eb63383230c90076f7956113 (diff)
downloadflashrom-edee3683b1b451089c6f160bb3540e65354a0e24.tar.gz
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. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@653 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'sb600spi.c')
-rw-r--r--sb600spi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sb600spi.c b/sb600spi.c
index 937550d..865a8c3 100644
--- a/sb600spi.c
+++ b/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);