From edee3683b1b451089c6f160bb3540e65354a0e24 Mon Sep 17 00:00:00 2001 From: hailfinger Date: Tue, 14 Jul 2009 10:26:56 +0000 Subject: 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 Acked-by: Stefan Reinauer git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@653 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- it87spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'it87spi.c') diff --git a/it87spi.c b/it87spi.c index d5f7a51..41ce6db 100644 --- a/it87spi.c +++ b/it87spi.c @@ -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. -- cgit v1.2.1