From: Uwe Bonnes Date: Wed, 8 Sep 2010 11:16:33 +0000 (+0200) Subject: Use ftdi_error_return for EEPROM error returns X-Git-Tag: v1.0rc1~133^2~129 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=cc9c9d58811e9efb38d274b5ce3baacfedd0b5d6;p=libftdi Use ftdi_error_return for EEPROM error returns --- 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;