Stefan Reinauer has uploaded this change for review. ( https://review.coreboot.org/c/em100/+/42571 )
Change subject: spi.c: Some fixes to the write_dfifo routine ......................................................................
spi.c: Some fixes to the write_dfifo routine
Change-Id: I25867012e644b825f0a352dacb20e9df3a0c0720 --- M spi.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/71/42571/1
diff --git a/spi.c b/spi.c index 1ac7004..c088a11 100644 --- a/spi.c +++ b/spi.c @@ -287,13 +287,13 @@ }
printf ("Transfer %s\n",bytes_sent == length ? "Succeeded" : "Failed"); - if (bytes_sent == length) + if (bytes_sent != length) printf("Warning: Sent %zd bytes, expected %zd\n", bytes_sent, length);
int len = get_response(em100->dev, data, 512);
- if (len == 1 && data[0] == length) { + if (len == 2 && (((size_t)data[0] << 8) | data[1]) == length) { return 1; } return 0;