diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-07-14 10:26:56 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-07-14 10:26:56 +0000 |
commit | 142e30fcaa1c3a63a1f0baf0b802ef888a0c250b (patch) | |
tree | c286d89dadacecee2e68b84ce5606467e9ae33e8 /wbsio_spi.c | |
parent | 78e4e127129398454813d1552b516638837c423e (diff) | |
download | ast2050-flashrom-142e30fcaa1c3a63a1f0baf0b802ef888a0c250b.zip ast2050-flashrom-142e30fcaa1c3a63a1f0baf0b802ef888a0c250b.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.
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>
Diffstat (limited to 'wbsio_spi.c')
-rw-r--r-- | wbsio_spi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wbsio_spi.c b/wbsio_spi.c index 7876198..ded0840 100644 --- a/wbsio_spi.c +++ b/wbsio_spi.c @@ -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); |