X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.c;h=78a7f4e809b907f6b02eee8e53d1b4e625a8a222;hp=139bbd9f8734c29c7fce3b20e4cde45b4592ba21;hb=cc9c9d58811e9efb38d274b5ce3baacfedd0b5d6;hpb=c0a96aed965e1010f131aaac4d7025ebf00c35dd 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;