From 2b9a3c8226573d507149b8ca6e5a925229dd691d Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Fri, 10 Sep 2010 13:24:57 +0200 Subject: [PATCH 1/1] ftdi_eeprom_build needs to know EEPROM chip type --- src/ftdi.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/ftdi.c b/src/ftdi.c index c3d5fd8..65a626f 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2261,6 +2261,7 @@ void ftdi_eeprom_free(struct ftdi_context *ftdi) \retval -3: Invalid cbus function setting \retval -4: Chip doesn't support invert \retval -5: Chip doesn't support high current drive + \retval -6: No connected EEPROM or EEPROM Type unknown */ int ftdi_eeprom_build(struct ftdi_context *ftdi, unsigned char *output) { @@ -2278,6 +2279,9 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi, unsigned char *output) eeprom= ftdi->eeprom; + if(eeprom->chip == -1) + ftdi_error_return(-5,"No connected EEPROM or EEPROM Type unknown"); + if (eeprom->manufacturer != NULL) manufacturer_size = strlen(eeprom->manufacturer); if (eeprom->product != NULL) -- 1.7.1