From cc9c9d58811e9efb38d274b5ce3baacfedd0b5d6 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Wed, 8 Sep 2010 13:16:33 +0200 Subject: [PATCH] Use ftdi_error_return for EEPROM error returns --- src/ftdi.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ftdi.c b/src/ftdi.c index 139bbd9..78a7f4e 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2270,9 +2270,9 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi, unsigned char *output) struct ftdi_eeprom *eeprom; if (ftdi == NULL) - return -2; + ftdi_error_return(-2,"No context"); if (ftdi->eeprom == NULL) - return -2; + ftdi_error_return(-2,"No eeprom structure"); eeprom= ftdi->eeprom; @@ -2498,9 +2498,9 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size) struct ftdi_eeprom *eeprom; if (ftdi == NULL) - return -1; + ftdi_error_return(-1,"No context"); if (ftdi->eeprom == NULL) - return -1; + ftdi_error_return(-1,"No eeprom"); eeprom = ftdi->eeprom; #if 0 @@ -2518,7 +2518,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size) // eeprom size exceeded? if (size_check < 0) - return (-1); + ftdi_error_return(-1,"Size check failed"); #endif // empty eeprom struct @@ -2661,7 +2661,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size) if (eeprom_checksum != checksum) { fprintf(stderr, "Checksum Error: %04x %04x\n", checksum, eeprom_checksum); - return -1; + ftdi_error_return(-1,"EEPROM checksum error"); } return 0; -- 1.7.1