X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.c;h=7f7e5a0f072376747e2e343b1d056672b9037524;hp=8bddd42532d7498fe427f2ee8c5cacd1766711bd;hb=95ac1ca2f571a87170fa5578412ef5cb64a941e0;hpb=ddfa995d1cd57cebfcc785ba4ed626aaafe6f1b6 diff --git a/src/ftdi.c b/src/ftdi.c index 8bddd42..7f7e5a0 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -490,7 +490,7 @@ int ftdi_usb_open_dev(struct ftdi_context *ftdi, libusb_device *dev) } else { - ftdi_error_return(-3, "unable to set usb configuration. Make sure the default FTDI kernel side driver is unloaded."); + ftdi_error_return(-3, "unable to set usb configuration. Make sure the default FTDI driver is not in use"); } } } @@ -504,7 +504,7 @@ int ftdi_usb_open_dev(struct ftdi_context *ftdi, libusb_device *dev) } else { - ftdi_error_return(-5, "unable to claim usb device. Make sure the default FTDI kernel side driver is unloaded."); + ftdi_error_return(-5, "unable to claim usb device. Make sure the default FTDI driver is not in use"); } } @@ -2205,6 +2205,27 @@ void ftdi_eeprom_initdefaults(struct ftdi_eeprom *eeprom) } /** + Frees allocated memory in eeprom. + + \param eeprom Pointer to ftdi_eeprom +*/ +void ftdi_eeprom_free(struct ftdi_eeprom *eeprom) +{ + if (eeprom->manufacturer != 0) { + free(eeprom->manufacturer); + eeprom->manufacturer = 0; + } + if (eeprom->product != 0) { + free(eeprom->product); + eeprom->product = 0; + } + if (eeprom->serial != 0) { + free(eeprom->serial); + eeprom->serial = 0; + } +} + +/** Build binary output from ftdi_eeprom structure. Output is suitable for ftdi_write_eeprom().